This commit is contained in:
Siana Gearz
2011-10-09 02:03:08 +02:00
25 changed files with 346 additions and 392 deletions

View File

@@ -283,28 +283,30 @@ LLEstateAssetRequest::~LLEstateAssetRequest()
// TODO: rework tempfile handling?
LLAssetStorage::LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, const LLHost &upstream_host)
LLAssetStorage::LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs, const LLHost &upstream_host)
{
_init(msg, xfer, vfs, upstream_host);
_init(msg, xfer, vfs, static_vfs, upstream_host);
}
LLAssetStorage::LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs)
LLVFS *vfs, LLVFS *static_vfs)
{
_init(msg, xfer, vfs, LLHost::invalid);
_init(msg, xfer, vfs, static_vfs, LLHost::invalid);
}
void LLAssetStorage::_init(LLMessageSystem *msg,
LLXferManager *xfer,
LLVFS *vfs,
LLVFS *static_vfs,
const LLHost &upstream_host)
{
mShutDown = FALSE;
mMessageSys = msg;
mXferManager = xfer;
mVFS = vfs;
mStaticVFS = static_vfs;
setUpstream(upstream_host);
msg->setHandlerFuncFast(_PREHASH_AssetUploadComplete, processUploadComplete, (void **)this);
@@ -396,7 +398,39 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType type)
{
return mVFS->getExists(uuid, type);
return mStaticVFS->getExists(uuid, type) || mVFS->getExists(uuid, type);
}
bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type,
LLGetAssetCallback callback, void *user_data)
{
if (user_data)
{
// The *user_data should not be passed without a callback to clean it up.
llassert(callback != NULL)
}
BOOL exists = mStaticVFS->getExists(uuid, type);
if (exists)
{
LLVFile file(mStaticVFS, uuid, type);
U32 size = file.getSize();
if (size > 0)
{
// we've already got the file
if (callback)
{
callback(mStaticVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
return true;
}
else
{
llwarns << "Asset vfile " << uuid << ":" << type
<< " found in static cache with bad size " << file.getSize() << ", ignoring" << llendl;
}
}
return false;
}
///////////////////////////////////////////////////////////////////////////
@@ -404,24 +438,39 @@ BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType
///////////////////////////////////////////////////////////////////////////
// IW - uuid is passed by value to avoid side effects, please don't re-add &
void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat), void *user_data, BOOL is_priority)
void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LLGetAssetCallback callback, void *user_data, BOOL is_priority)
{
lldebugs << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl;
llinfos << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
if (user_data)
{
// The *user_data should not be passed without a callback to clean it up.
llassert(callback != NULL)
}
if (mShutDown)
{
return; // don't get the asset or do any callbacks, we are shutting down
llinfos << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE);
}
return;
}
if (uuid.isNull())
{
// Special case early out for NULL uuid
// Special case early out for NULL uuid and for shutting down
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
}
return;
}
/* <edit> */
if(std::find(mBlackListedAsset.begin(),mBlackListedAsset.end(),uuid) != mBlackListedAsset.end())
{
@@ -434,11 +483,31 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
}
/* </edit> */
// Try static VFS first.
if (findInStaticVFSAndInvokeCallback(uuid,type,callback,user_data))
{
llinfos << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl;
return;
}
BOOL exists = mVFS->getExists(uuid, type);
LLVFile file(mVFS, uuid, type);
U32 size = exists ? file.getSize() : 0;
if (size < 1)
if (size > 0)
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
llinfos << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl;
}
else
{
if (exists)
{
@@ -477,18 +546,13 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
// This can be overridden by subclasses
_queueDataRequest(uuid, type, callback, user_data, duplicate, is_priority);
}
else
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
}
}
//
// *NOTE: Logic here is replicated in LLViewerAssetStorage::_queueDataRequest.
// Changes here may need to be replicated in the viewer's derived class.
//
void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType atype,
LLGetAssetCallback callback,
void *user_data, BOOL duplicate,
@@ -516,7 +580,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at
tpvf.setAsset(uuid, atype);
tpvf.setCallback(downloadCompleteCallback, req);
llinfos << "Starting transfer for " << uuid << llendl;
//llinfos << "Starting transfer for " << uuid << llendl;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET);
ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f));
}
@@ -539,6 +603,8 @@ void LLAssetStorage::downloadCompleteCallback(
LLAssetType::EType file_type,
void* user_data, LLExtStat ext_status)
{
llinfos << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << llendl;
lldebugs << "LLAssetStorage::downloadCompleteCallback() for " << file_id
<< "," << LLAssetType::lookup(file_type) << llendl;
LLAssetRequest* req = (LLAssetRequest*)user_data;
@@ -627,11 +693,27 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
return;
}
// Try static VFS first.
if (findInStaticVFSAndInvokeCallback(asset_id,atype,callback,user_data))
{
return;
}
BOOL exists = mVFS->getExists(asset_id, atype);
LLVFile file(mVFS, asset_id, atype);
U32 size = exists ? file.getSize() : 0;
if (size < 1)
if (size > 0)
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
}
else
{
if (exists)
{
@@ -682,16 +764,6 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
}
}
}
else
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
}
}
void LLAssetStorage::downloadEstateAssetCompleteCallback(
@@ -758,6 +830,12 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
if(asset_id.notNull())
{
// Try static VFS first.
if (findInStaticVFSAndInvokeCallback( asset_id, atype, callback, user_data))
{
return;
}
exists = mVFS->getExists(asset_id, atype);
LLVFile file(mVFS, asset_id, atype);
size = exists ? file.getSize() : 0;
@@ -769,7 +847,17 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
}
if (size < 1)
if (size > 0)
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
}
else
{
// See whether we should talk to the object's originating sim,
// or the upstream provider.
@@ -818,16 +906,6 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
}
}
}
else
{
// we've already got the file
// theoretically, partial files w/o a pending request shouldn't happen
// unless there's a weird error
if (callback)
{
callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
}
}

View File

@@ -218,6 +218,7 @@ class LLAssetStorage : public LLTempAssetStorage
public:
// VFS member is public because static child methods need it :(
LLVFS *mVFS;
LLVFS *mStaticVFS;
typedef void (*LLStoreAssetCallback)(const LLUUID &asset_id, void *user_data, S32 status, LLExtStat ext_status);
enum ERequestType
@@ -247,10 +248,10 @@ protected:
public:
LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs, const LLHost &upstream_host);
LLVFS *vfs, LLVFS *static_vfs, const LLHost &upstream_host);
LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs);
LLVFS *vfs, LLVFS *static_vfs);
virtual ~LLAssetStorage();
void setUpstream(const LLHost &upstream_host);
@@ -317,6 +318,9 @@ public:
void markAssetToxic( const LLUUID& uuid );
protected:
bool findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type,
LLGetAssetCallback callback, void *user_data);
virtual LLSD getPendingDetailsImpl(const request_list_t* requests,
LLAssetType::EType asset_type,
const std::string& detail_prefix) const;
@@ -444,6 +448,7 @@ private:
void _init(LLMessageSystem *msg,
LLXferManager *xfer,
LLVFS *vfs,
LLVFS *static_vfs,
const LLHost &upstream_host);
protected:

View File

@@ -400,21 +400,23 @@ size_t LLHTTPAssetRequest::curlCompressedUploadCallback(
LLHTTPAssetStorage::LLHTTPAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs, const LLHost &upstream_host,
LLVFS *vfs, LLVFS *static_vfs,
const LLHost &upstream_host,
const std::string& web_host,
const std::string& local_web_host,
const std::string& host_name)
: LLAssetStorage(msg, xfer, vfs, upstream_host)
: LLAssetStorage(msg, xfer, vfs, static_vfs, upstream_host)
{
_init(web_host, local_web_host, host_name);
}
LLHTTPAssetStorage::LLHTTPAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs,
LLVFS *static_vfs,
const std::string& web_host,
const std::string& local_web_host,
const std::string& host_name)
: LLAssetStorage(msg, xfer, vfs)
: LLAssetStorage(msg, xfer, vfs, static_vfs)
{
_init(web_host, local_web_host, host_name);
}

View File

@@ -48,13 +48,14 @@ class LLHTTPAssetStorage : public LLAssetStorage
{
public:
LLHTTPAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs, const LLHost &upstream_host,
LLVFS *vfs, LLVFS *static_vfs,
const LLHost &upstream_host,
const std::string& web_host,
const std::string& local_web_host,
const std::string& host_name);
LLHTTPAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs,
LLVFS *vfs, LLVFS *static_vfs,
const std::string& web_host,
const std::string& local_web_host,
const std::string& host_name);

View File

@@ -934,13 +934,7 @@ LLRender::LLRender()
mMode(LLRender::TRIANGLES),
mCurrTextureUnitIndex(0),
mMaxAnisotropy(0.f)
{
mBuffer = new LLVertexBuffer(immediate_mask, 0);
mBuffer->allocateBuffer(4096, 0, TRUE);
mBuffer->getVertexStrider(mVerticesp);
mBuffer->getTexCoord0Strider(mTexcoordsp);
mBuffer->getColorStrider(mColorsp);
{
mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS);
for (U32 i = 0; i < LL_NUM_TEXTURE_LAYERS; i++)
{
@@ -971,6 +965,17 @@ LLRender::~LLRender()
shutdown();
}
void LLRender::init()
{
llassert_always(mBuffer.isNull()) ;
mBuffer = new LLVertexBuffer(immediate_mask, 0);
mBuffer->allocateBuffer(4096, 0, TRUE);
mBuffer->getVertexStrider(mVerticesp);
mBuffer->getTexCoord0Strider(mTexcoordsp);
mBuffer->getColorStrider(mColorsp);
}
void LLRender::shutdown()
{
for (U32 i = 0; i < mTexUnits.size(); i++)
@@ -986,6 +991,7 @@ void LLRender::shutdown()
delete mLightState[i];
}
mLightState.clear();
mBuffer = NULL ;
}
void LLRender::refreshState(void)

View File

@@ -314,6 +314,7 @@ public:
LLRender();
~LLRender();
void init() ;
void shutdown();
// Refreshes renderer state to the cached values

View File

@@ -1320,6 +1320,7 @@
name="Hair_Egg_Head"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="-1.3"
value_max="1">
<param_morph />
@@ -1331,6 +1332,7 @@
name="Hair_Squash_Stretch_Head"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="-.5"
value_max="1">
<param_morph />
@@ -1342,6 +1344,7 @@
name="Hair_Square_Head"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="0"
value_max="1">
<param_morph />
@@ -1353,6 +1356,7 @@
name="Hair_Round_Head"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="0"
value_max="1">
<param_morph />
@@ -1364,6 +1368,7 @@
name="Hair_Forehead_Round"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="0"
value_max="1">
<param_morph />
@@ -1375,6 +1380,7 @@
name="Hair_Forehead_Slant"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="0"
value_max="1">
<param_morph />
@@ -1386,6 +1392,7 @@
name="Shear_Head_Hair"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="-2"
value_max="2">
<param_morph />
@@ -1397,6 +1404,7 @@
name="Elongate_Head_Hair"
wearable="hair"
edit_group="hair_style"
cross_wearable="true"
value_min="-1"
value_max="1">
<param_morph />
@@ -4902,6 +4910,7 @@
clothing_morph="false"
wearable="skirt"
edit_group="skirt"
cross_wearable="true"
label_min="form fitting"
label_max="loose"
value_min="0"
@@ -4936,6 +4945,7 @@
label="legs skirt"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
value_min="-1"
value_max="1"
value_default="0">
@@ -4948,6 +4958,7 @@
name="skirt_bigbutt"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
label="bigbutt skirt"
label_min="less"
label_max="more"
@@ -4962,6 +4973,7 @@
name="skirt_belly"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
label="big belly skirt"
value_min="0"
value_max="1">
@@ -4973,6 +4985,7 @@
group="1"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
name="skirt_saddlebags"
value_min="-.5"
value_max="3">
@@ -4985,6 +4998,7 @@
name="skirt_chubby"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
label_min="less"
label_max="more"
value_min="0"
@@ -4999,6 +5013,7 @@
name="skirt_lovehandles"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
label_min="less"
label_max="more"
value_min="-1"
@@ -5018,6 +5033,7 @@
name="skirt_male"
wearable="skirt"
edit_group="driven"
cross_wearable="true"
value_min="0"
value_max="1">
<param_morph />
@@ -7623,6 +7639,7 @@
id="1020"
group="1"
edit_group="driven"
wearable="jacket"
name="jacket Sleeve Length"
value_min="0"
value_max="1">
@@ -7635,6 +7652,7 @@
<param
id="1022"
group="1"
wearable="jacket"
edit_group="driven"
name="jacket Collar Front"
value_min="0"
@@ -7648,6 +7666,7 @@
<param
id="1024"
group="1"
wearable="jacket"
edit_group="driven"
edit_group_order="3.5"
name="jacket Collar Back"
@@ -7758,6 +7777,7 @@
group="1"
name="Shading"
wearable="pants"
cross_wearable="true"
value_min="0"
value_max="1">
<param_color>
@@ -8428,6 +8448,7 @@
group="1"
wearable="jacket"
edit_group="driven"
cross_wearable="true"
name="jacket bottom length lower bump"
value_min="0"
value_max="1">
@@ -8906,7 +8927,7 @@
id="1017" />
<driven
id="1033" />
id="1035" />
<driven
id="914"

View File

@@ -1029,7 +1029,7 @@ BOOL LLDrawable::isVisible() const
return TRUE;
}
#if 1
#if 0
//disabling this code fixes DEV-20105. Leaving in place in case some other bug pops up as a a result.
//should be safe to just always ask the spatial group for visibility.
if (isActive())

View File

@@ -35,8 +35,6 @@
#include "lldrawpool.h"
class LLViewerFetchedTexture;
class LLDrawPoolTerrain : public LLFacePool
{
LLPointer<LLViewerTexture> mTexturep;

View File

@@ -114,7 +114,7 @@ void LLDrawPoolWater::prerender()
// got rid of modulation by light color since it got a little too
// green at sunset and sl-57047 (underwater turns black at 8:00)
sWaterFogColor = LLWaterParamManager::getInstance()->getFogColor();
sWaterFogColor = LLWaterParamManager::instance().getFogColor();
sWaterFogColor.mV[3] = 0;
}
@@ -532,7 +532,7 @@ void LLDrawPoolWater::shade()
//bind normal map
S32 bumpTex = shader->enableTexture(LLViewerShaderMgr::BUMP_MAP);
LLWaterParamManager * param_mgr = LLWaterParamManager::getInstance();
LLWaterParamManager * param_mgr = &LLWaterParamManager::instance();
// change mWaterNormp if needed
if (mWaterNormp->getID() != param_mgr->getNormalMapID())

View File

@@ -73,9 +73,6 @@
#include "rlvhandler.h"
// [/RLVa:KB]
extern BOOL gDebugSelect;
// Returns true if you got at least one object
void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
{

View File

@@ -453,9 +453,9 @@ LLMeshRepoThread::LLMeshRepoThread()
: LLThread("mesh repo")
{
mWaiting = false;
mMutex = new LLMutex;
mHeaderMutex = new LLMutex;
mSignal = new LLCondition;
mMutex = new LLMutex();
mHeaderMutex = new LLMutex();
mSignal = new LLCondition();
}
LLMeshRepoThread::~LLMeshRepoThread()
@@ -1208,7 +1208,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mUploadTextures = upload_textures;
mUploadSkin = upload_skin;
mUploadJoints = upload_joints;
mMutex = new LLMutex(NULL);
mMutex = new LLMutex();
mCurlRequest = NULL;
mPendingUploads = 0;
mFinished = false;
@@ -2061,7 +2061,7 @@ LLMeshRepository::LLMeshRepository()
void LLMeshRepository::init()
{
mMeshMutex = new LLMutex;
mMeshMutex = new LLMutex();
#if MESH_IMPORT
LLConvexDecomposition::getInstance()->initSystem();

View File

@@ -113,8 +113,6 @@ const S32 TE_SELECT_MASK_ALL = 0xFFFFFFFF;
// Globals
//
//BOOL gDebugSelectMgr = FALSE;
//BOOL gHideSelectedObjects = FALSE;
//BOOL gAllowSelectAvatar = FALSE;
@@ -1882,7 +1880,7 @@ void LLSelectMgr::selectionSetFullbright(U8 fullbright)
void LLSelectMgr::selectionSetMediaTypeAndURL(U8 media_type, const std::string& media_url)
{
U8 media_flags = LLTextureEntry::MF_NONE;
if (media_type == LLViewerObject::MEDIA_TYPE_WEB_PAGE)
if (media_type == LLViewerObject::MEDIA_SET)
{
media_flags = LLTextureEntry::MF_HAS_MEDIA;
}

View File

@@ -607,7 +607,7 @@ bool idle_startup()
gXferManager->setUseAckThrottling(TRUE);
gXferManager->setAckThrottleBPS(xfer_throttle_bps);
}
gAssetStorage = new LLViewerAssetStorage(msg, gXferManager, gVFS);
gAssetStorage = new LLViewerAssetStorage(msg, gXferManager, gVFS, gStaticVFS);
F32 dropPercent = gSavedSettings.getF32("PacketDropPercentage");
@@ -2743,7 +2743,7 @@ bool idle_startup()
if (gAgent.isFirstLogin()
&& !sInitialOutfit.empty() // registration set up an outfit
&& !sInitialOutfitGender.empty() // and a gender
&& gAgentAvatarp // can't wear clothes without object
&& isAgentAvatarValid() // can't wear clothes without object
&& !gAgent.isGenderChosen() ) // nothing already loading
{
// Start loading the wearables, textures, gestures
@@ -2766,7 +2766,7 @@ bool idle_startup()
}
// wait precache-delay and for agent's avatar or a lot longer.
if(((timeout_frac > 1.f) && gAgentAvatarp)
if(((timeout_frac > 1.f) && isAgentAvatarValid())
|| (timeout_frac > 3.f))
{
LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
@@ -2822,7 +2822,7 @@ bool idle_startup()
if (gAgent.isFirstLogin())
{
// wait for avatar to be completely loaded
if (gAgentAvatarp
if (isAgentAvatarValid()
&& gAgentAvatarp->isFullyLoaded())
{
//llinfos << "avatar fully loaded" << llendl;
@@ -2889,7 +2889,6 @@ bool idle_startup()
// Start automatic replay if the flag is set.
if (gSavedSettings.getBOOL("StatsAutoRun"))
{
LLUUID id;
LL_DEBUGS("AppInit") << "Starting automatic playback" << LL_ENDL;
gAgentPilot.startPlayback();
}

View File

@@ -40,16 +40,18 @@
#include "llvfile.h"
#include "llvfs.h"
LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs, const LLHost &upstream_host)
: LLAssetStorage(msg, xfer, vfs, upstream_host)
LLVFS *vfs, LLVFS *static_vfs,
const LLHost &upstream_host)
: LLAssetStorage(msg, xfer, vfs, static_vfs, upstream_host)
{
}
LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs)
: LLAssetStorage(msg, xfer, vfs)
LLVFS *vfs, LLVFS *static_vfs)
: LLAssetStorage(msg, xfer, vfs, static_vfs)
{
}

View File

@@ -42,10 +42,10 @@ class LLViewerAssetStorage : public LLAssetStorage
{
public:
LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs, const LLHost &upstream_host);
LLVFS *vfs, LLVFS *static_vfs, const LLHost &upstream_host);
LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer,
LLVFS *vfs);
LLVFS *vfs, LLVFS *static_vfs);
using LLAssetStorage::storeAssetData;
virtual void storeAssetData(

View File

@@ -364,7 +364,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived.
S32 attach_count = 0;
if (gAgentAvatarp)
if (isAgentAvatarValid())
{
attach_count = gAgentAvatarp->getAttachmentCount();
}
@@ -546,7 +546,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Disconnected");
render_ui();
render_disconnected_background();
}
//////////////////////////
@@ -1128,13 +1127,11 @@ LLRect get_whole_screen_region()
bool get_hud_matrices(const LLRect& screen_region, glh::matrix4f &proj, glh::matrix4f &model)
{
LLVOAvatar* my_avatarp = gAgentAvatarp;
if (my_avatarp && my_avatarp->hasHUDAttachment())
if (isAgentAvatarValid() && gAgentAvatarp->hasHUDAttachment())
{
F32 zoom_level = gAgentCamera.mHUDCurZoom;
LLBBox hud_bbox = my_avatarp->getHUDBBox();
// set up transform to keep HUD objects in front of camera
LLBBox hud_bbox = gAgentAvatarp->getHUDBBox();
F32 hud_depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f);
proj = gl_ortho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, hud_depth);
proj.element(2,2) = -0.01f;
@@ -1422,10 +1419,6 @@ void render_ui_2d()
stop_glerror();
}
gViewerWindow->draw();
if (gDebugSelect)
{
gViewerWindow->drawPickBuffer();
}
// reset current origin for font rendering, in case of tiling render
LLFontGL::sCurOrigin.set(0, 0);

View File

@@ -291,7 +291,6 @@ void handle_test_load_url(void*);
extern BOOL gDebugClicks;
extern BOOL gDebugWindowProc;
extern BOOL gDebugTextEditorTips;
//extern BOOL gDebugSelectMgr;
extern BOOL gDebugAvatarRotation;
extern BOOL gShowOverlayTitle;
extern BOOL gOcclusionCull;

View File

@@ -140,7 +140,6 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
{
if (!gAgentAvatarp)
{
lldebugs << "Marking avatar as self " << id << llendl;
gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp);
gAgentAvatarp->initInstance();
}
@@ -741,6 +740,42 @@ void LLViewerObject::hideExtraDisplayItems( BOOL hidden )
}
}
U32 LLViewerObject::checkMediaURL(const std::string &media_url)
{
U32 retval = (U32)0x0;
if (!mMedia && !media_url.empty())
{
retval |= MEDIA_URL_ADDED;
mMedia = new LLViewerObjectMedia;
mMedia->mMediaURL = media_url;
mMedia->mMediaType = LLViewerObject::MEDIA_SET;
mMedia->mPassedWhitelist = FALSE;
}
else if (mMedia)
{
if (media_url.empty())
{
retval |= MEDIA_URL_REMOVED;
delete mMedia;
mMedia = NULL;
}
else if (mMedia->mMediaURL != media_url) // <-- This is an optimization. If they are equal don't bother with below's test.
{
/*if (! (LLTextureEntry::getAgentIDFromMediaVersionString(media_url) == gAgent.getID() &&
LLTextureEntry::getVersionFromMediaVersionString(media_url) ==
LLTextureEntry::getVersionFromMediaVersionString(mMedia->mMediaURL) + 1))
*/
{
// If the media URL is different and WE were not the one who
// changed it, mark dirty.
retval |= MEDIA_URL_UPDATED;
}
mMedia->mMediaURL = media_url;
mMedia->mPassedWhitelist = FALSE;
}
}
return retval;
}
U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
@@ -1119,35 +1154,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
std::string media_url;
mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_MediaURL, media_url, block_num);
//if (!media_url.empty())
//{
// llinfos << "WEBONPRIM media_url " << media_url << llendl;
//}
if (!mMedia && !media_url.empty())
{
retval |= MEDIA_URL_ADDED;
mMedia = new LLViewerObjectMedia;
mMedia->mMediaURL = media_url;
mMedia->mMediaType = LLViewerObject::MEDIA_TYPE_WEB_PAGE;
mMedia->mPassedWhitelist = FALSE;
}
else if (mMedia)
{
if (media_url.empty())
{
retval |= MEDIA_URL_REMOVED;
delete mMedia;
mMedia = NULL;
}
else if (mMedia->mMediaURL != media_url)
{
// We just added or changed a web page.
retval |= MEDIA_URL_UPDATED;
mMedia->mMediaURL = media_url;
mMedia->mPassedWhitelist = FALSE;
}
}
retval |= checkMediaURL(media_url);
//
// Unpack particle system data
//
@@ -1547,31 +1555,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
mText = NULL;
}
std::string media_url;
if (value & 0x200)
{
std::string media_url;
dp->unpackString(media_url, "MediaURL");
if (!mMedia)
{
retval |= MEDIA_URL_ADDED;
mMedia = new LLViewerObjectMedia;
mMedia->mMediaURL = media_url;
mMedia->mMediaType = LLViewerObject::MEDIA_TYPE_WEB_PAGE;
mMedia->mPassedWhitelist = FALSE;
}
else if (mMedia->mMediaURL != media_url)
{
retval |= MEDIA_URL_UPDATED;
mMedia->mMediaURL = media_url;
mMedia->mPassedWhitelist = FALSE;
}
}
else if (mMedia)
{
retval |= MEDIA_URL_REMOVED;
delete mMedia;
mMedia = NULL;
}
retval |= checkMediaURL(media_url);
//
// Unpack particle system data
@@ -3864,7 +3853,7 @@ U8 LLViewerObject::getMediaType() const
}
else
{
return LLViewerObject::MEDIA_TYPE_NONE;
return LLViewerObject::MEDIA_NONE;
}
}
@@ -5682,6 +5671,17 @@ std::string LLViewerObject::getAttachmentPointName()
return llformat("unsupported point %d", point);
}
// </edit>
const LLUUID &LLViewerObject::getAttachmentItemID() const
{
return mAttachmentItemID;
}
void LLViewerObject::setAttachmentItemID(const LLUUID &id)
{
mAttachmentItemID = id;
}
EObjectUpdateType LLViewerObject::getLastUpdateType() const
{
return mLastUpdateType;
@@ -5725,7 +5725,7 @@ LLVOAvatar* LLViewerObject::getAvatar() const
{
LLViewerObject* vobj = (LLViewerObject*) getParent();
while (vobj && !vobj->isAvatar())
while (vobj && !vobj->asAvatar())
{
vobj = (LLViewerObject*) vobj->getParent();
}

View File

@@ -158,10 +158,15 @@ public:
virtual BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
// Types of media we can associate
enum { MEDIA_TYPE_NONE = 0, MEDIA_TYPE_WEB_PAGE = 1 };
enum { MEDIA_NONE = 0, MEDIA_SET = 1 };
// Return codes for processUpdateMessage
enum { MEDIA_URL_REMOVED = 0x1, MEDIA_URL_ADDED = 0x2, MEDIA_URL_UPDATED = 0x4, INVALID_UPDATE = 0x80000000 };
enum {
MEDIA_URL_REMOVED = 0x1,
MEDIA_URL_ADDED = 0x2,
MEDIA_URL_UPDATED = 0x4,
INVALID_UPDATE = 0x80000000
};
virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
@@ -546,6 +551,10 @@ private:
ExtraParameter* getExtraParameterEntry(U16 param_type) const;
ExtraParameter* getExtraParameterEntryCreate(U16 param_type);
bool unpackParameterEntry(U16 param_type, LLDataPacker *dp);
// This function checks to see if the given media URL has changed its version
// and the update wasn't due to this agent's last action.
U32 checkMediaURL(const std::string &media_url);
// Motion prediction between updates
void interpolateLinearMotion(const F64 & time, const F32 & dt);
@@ -763,8 +772,8 @@ public:
S32 getAttachmentPoint();
std::string getAttachmentPointName();
// </edit>
const LLUUID &getAttachmentItemID() const { return mAttachmentItemID; }
void setAttachmentItemID(const LLUUID &id) { mAttachmentItemID = id; }
const LLUUID &getAttachmentItemID() const;
void setAttachmentItemID(const LLUUID &id);
const LLUUID &extractAttachmentItemID(); // find&set the inventory item ID of the attached object
EObjectUpdateType getLastUpdateType() const;
void setLastUpdateType(EObjectUpdateType last_update_type);
@@ -812,8 +821,8 @@ public:
class LLAlphaObject : public LLViewerObject
{
public:
LLAlphaObject(const LLUUID &id, const LLPCode type, LLViewerRegion *regionp)
: LLViewerObject(id,type,regionp)
LLAlphaObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
: LLViewerObject(id,pcode,regionp)
{ mDepth = 0.f; }
virtual F32 getPartSize(S32 idx);

View File

@@ -488,7 +488,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (objectp->getRegion() != regionp)
{ // Object changed region, so update it
objectp->setRegion(regionp);
objectp->updateRegion(regionp); // for LLVOAvatar
}
}
@@ -1239,8 +1238,9 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
{
// Don't commit suicide just because someone thinks you are on a ledge. -SG
if (objectp == gAgentAvatarp)
// Don't ever kill gAgentAvatarp, just force it to the agent's region
// unless region is NULL which is assumed to mean you are logging out.
if ((objectp == gAgentAvatarp) && gAgent.getRegion())
{
objectp->setRegion(gAgent.getRegion());
return FALSE;
@@ -1746,22 +1746,21 @@ void LLViewerObjectList::generatePickList(LLCamera &camera)
// add all hud objects to pick list
if (isAgentAvatarValid())
{
LLVOAvatar* avatarp = gAgentAvatarp;
for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
iter != avatarp->mAttachmentPoints.end(); )
for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != gAgentAvatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachmentp = curiter->second;
if (attachmentp->getIsHUDAttachment())
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getIsHUDAttachment())
{
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachmentp->mAttachedObjects.begin();
attachment_iter != attachmentp->mAttachedObjects.end();
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
if (LLViewerObject* objectp = (*attachment_iter))
if (LLViewerObject* attached_object = (*attachment_iter))
{
mSelectPickList.insert(objectp);
LLViewerObject::const_child_list_t& child_list = objectp->getChildren();
mSelectPickList.insert(attached_object);
LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); iter++)
{

View File

@@ -220,9 +220,6 @@ extern S32 gJamesInt;
LLViewerWindow *gViewerWindow = NULL;
LLVelocityBar *gVelocityBar = NULL;
BOOL gDebugSelect = FALSE;
LLFrameTimer gMouseIdleTimer;
LLFrameTimer gAwayTimer;
LLFrameTimer gAwayTriggerTimer;
@@ -363,7 +360,7 @@ public:
agent_center_text = llformat("AgentCenter %f %f %f",
(F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
if (gAgentAvatarp)
if (isAgentAvatarValid())
{
tvector = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mRoot.getWorldPosition());
agent_root_center_text = llformat("AgentRootCenter %f %f %f",
@@ -1449,6 +1446,7 @@ LLViewerWindow::LLViewerWindow(
}
LLVertexBuffer::initClass(gSavedSettings.getBOOL("RenderVBOEnable"), gSavedSettings.getBOOL("RenderVBOMappingDisable"));
LL_INFOS("RenderInit") << "LLVertexBuffer initialization done." << LL_ENDL ;
gGL.init() ;
if (LLFeatureManager::getInstance()->isSafe()
|| (gSavedSettings.getS32("LastFeatureVersion") != LLFeatureManager::getInstance()->getVersion())
@@ -3391,27 +3389,8 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback
pick_transparent = TRUE;
}
// center initial pick frame buffer region under mouse cursor
// since that area is guaranteed to be onscreen and hence a valid
// part of the framebuffer
if (mPicks.empty())
{
mPickScreenRegion.setCenterAndSize(x, y_from_bot, PICK_DIAMETER, PICK_DIAMETER);
if (mPickScreenRegion.mLeft < 0) mPickScreenRegion.translate(-mPickScreenRegion.mLeft, 0);
if (mPickScreenRegion.mBottom < 0) mPickScreenRegion.translate(0, -mPickScreenRegion.mBottom);
if (mPickScreenRegion.mRight > mWindowRectRaw.getWidth() ) mPickScreenRegion.translate(mWindowRectRaw.getWidth() - mPickScreenRegion.mRight, 0);
if (mPickScreenRegion.mTop > mWindowRectRaw.getHeight() ) mPickScreenRegion.translate(0, mWindowRectRaw.getHeight() - mPickScreenRegion.mTop);
}
// set frame buffer region for picking results
// stack multiple picks left to right
LLRect screen_region = mPickScreenRegion;
screen_region.translate(mPicks.size() * PICK_DIAMETER, 0);
LLPickInfo pick(LLCoordGL(x, y_from_bot), screen_region, mask, pick_transparent, get_surface_info, callback);
schedulePick(pick);
LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, get_surface_info, callback);
schedulePick(pick_info);
}
void LLViewerWindow::schedulePick(LLPickInfo& pick_info)
@@ -3426,7 +3405,6 @@ void LLViewerWindow::schedulePick(LLPickInfo& pick_info)
return;
}
llassert_always(pick_info.mScreenRegion.notEmpty());
mPicks.push_back(pick_info);
// delay further event processing until we receive results of pick
@@ -3477,11 +3455,10 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans
return LLPickInfo();
}
pickAsync(x, y_from_bot, gKeyboard->currentMask(TRUE), NULL, pick_transparent);
// assume that pickAsync put the results in the back of the mPicks list
mLastPick = mPicks.back();
// shortcut queueing in mPicks and just update mLastPick in place
MASK key_mask = gKeyboard->currentMask(TRUE);
mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, TRUE, NULL);
mLastPick.fetchResults();
mPicks.pop_back();
return mLastPick;
}
@@ -5038,12 +5015,6 @@ F32 LLViewerWindow::getDisplayAspectRatio() const
}
}
void LLViewerWindow::drawPickBuffer() const
{
mHoverPick.drawPickBuffer();
}
void LLViewerWindow::calcDisplayScale()
{
F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor");
@@ -5213,13 +5184,11 @@ LLPickInfo::LLPickInfo()
}
LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos,
const LLRect& screen_region,
MASK keyboard_mask,
BOOL pick_transparent,
BOOL pick_uv_coords,
void (*pick_callback)(const LLPickInfo& pick_info))
: mMousePt(mouse_pos),
mScreenRegion(screen_region),
mKeyMask(keyboard_mask),
mPickCallback(pick_callback),
mPickType(PICK_INVALID),
@@ -5235,10 +5204,6 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos,
{
}
LLPickInfo::~LLPickInfo()
{
}
void LLPickInfo::fetchResults()
{
@@ -5257,59 +5222,14 @@ void LLPickInfo::fetchResults()
NULL, -1, mPickTransparent, &face_hit,
&intersection, &uv, &normal, &binormal);
// read back colors and depth values from buffer
//glReadPixels(mScreenRegion.mLeft, mScreenRegion.mBottom, mScreenRegion.getWidth(), mScreenRegion.getHeight(), GL_RGBA, GL_UNSIGNED_BYTE, mPickBuffer);
//glReadPixels(mScreenRegion.mLeft, mScreenRegion.mBottom, mScreenRegion.getWidth(), mScreenRegion.getHeight(), GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, mPickDepthBuffer );
// find pick region that is fully onscreen
//LLCoordGL scaled_pick_point;;
//scaled_pick_point.mX = llclamp(llround((F32)mMousePt.mX * gViewerWindow->getDisplayScale().mV[VX]), PICK_HALF_WIDTH, gViewerWindow->getWindowDisplayWidth() - PICK_HALF_WIDTH);
//scaled_pick_point.mY = llclamp(llround((F32)mMousePt.mY * gViewerWindow->getDisplayScale().mV[VY]), PICK_HALF_WIDTH, gViewerWindow->getWindowDisplayHeight() - PICK_HALF_WIDTH);
//S32 pixel_index = PICK_HALF_WIDTH * PICK_DIAMETER + PICK_HALF_WIDTH;
//S32 pick_id = (U32)mPickBuffer[(pixel_index * 4) + 0] << 16 | (U32)mPickBuffer[(pixel_index * 4) + 1] << 8 | (U32)mPickBuffer[(pixel_index * 4) + 2];
//F32 depth = mPickDepthBuffer[pixel_index];
//S32 x_offset = mMousePt.mX - llround((F32)scaled_pick_point.mX / gViewerWindow->getDisplayScale().mV[VX]);
//S32 y_offset = mMousePt.mY - llround((F32)scaled_pick_point.mY / gViewerWindow->getDisplayScale().mV[VY]);
mPickPt = mMousePt;
// we hit nothing, scan surrounding pixels for something useful
/*if (!pick_id)
{
S32 closest_distance = 10000;
//S32 closest_pick_name = 0;
for (S32 col = 0; col < PICK_DIAMETER; col++)
{
for (S32 row = 0; row < PICK_DIAMETER; row++)
{
S32 distance_squared = (llabs(col - x_offset - PICK_HALF_WIDTH) * llabs(col - x_offset - PICK_HALF_WIDTH)) + (llabs(row - y_offset - PICK_HALF_WIDTH) * llabs(row - y_offset - PICK_HALF_WIDTH));
pixel_index = row * PICK_DIAMETER + col;
S32 test_name = (U32)mPickBuffer[(pixel_index * 4) + 0] << 16 | (U32)mPickBuffer[(pixel_index * 4) + 1] << 8 | (U32)mPickBuffer[(pixel_index * 4) + 2];
if (test_name && distance_squared < closest_distance)
{
closest_distance = distance_squared;
pick_id = test_name;
depth = mPickDepthBuffer[pixel_index];
mPickPt.mX = mMousePt.mX + (col - PICK_HALF_WIDTH);
mPickPt.mY = mMousePt.mY + (row - PICK_HALF_WIDTH);
}
}
}
}*/
U32 te_offset = face_hit > -1 ? face_hit : 0;
//pick_id &= 0x000fffff;
//unproject relative clicked coordinate from window coordinate using GL
LLViewerObject* objectp = hit_object;
//if (pick_id == (S32)GL_NAME_PARCEL_WALL)
//{
// mPickType = PICK_PARCEL_WALL;
//}
if (hit_icon &&
(!objectp ||
icon_dist < (LLViewerCamera::getInstance()->getOrigin()-intersection).magVec()))
@@ -5353,20 +5273,6 @@ void LLPickInfo::fetchResults()
mObjectID = objectp->mID;
mObjectFace = (te_offset == NO_FACE) ? -1 : (S32)te_offset;
/*glh::matrix4f newModel((F32*)LLViewerCamera::getInstance()->getModelview().mMatrix);
for(U32 i = 0; i < 16; ++i)
{
modelview[i] = newModel.m[i];
projection[i] = LLViewerCamera::getInstance()->getProjection().mMatrix[i/4][i%4];
}
glGetIntegerv( GL_VIEWPORT, viewport );
winX = ((F32)mPickPt.mX) * gViewerWindow->getDisplayScale().mV[VX];
winY = ((F32)mPickPt.mY) * gViewerWindow->getDisplayScale().mV[VY];
gluUnProject( winX, winY, depth, modelview, projection, viewport, &posX, &posY, &posZ);*/
mPosGlobal = gAgent.getPosGlobalFromAgent(intersection);
if (mWantSurfaceInfo)
@@ -5401,49 +5307,6 @@ void LLPickInfo::updateXYCoords()
}
}
void LLPickInfo::drawPickBuffer() const
{
if (mPickBuffer)
{
gGL.pushMatrix();
LLGLDisable no_blend(GL_BLEND);
LLGLDisable no_alpha_test(GL_ALPHA_TEST);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
glPixelZoom(10.f, 10.f);
LLVector2 display_scale = gViewerWindow->getDisplayScale();
glRasterPos2f(((F32)mMousePt.mX * display_scale.mV[VX] + 10.f),
((F32)mMousePt.mY * display_scale.mV[VY] + 10.f));
glDrawPixels(PICK_DIAMETER, PICK_DIAMETER, GL_RGBA, GL_UNSIGNED_BYTE, mPickBuffer);
glPixelZoom(1.f, 1.f);
gGL.color4fv(LLColor4::white.mV);
gl_rect_2d(llround((F32)mMousePt.mX * display_scale.mV[VX] - (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mY * display_scale.mV[VY] + (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mX * display_scale.mV[VX] + (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mY * display_scale.mV[VY] - (F32)(PICK_HALF_WIDTH)),
FALSE);
gl_line_2d(llround((F32)mMousePt.mX * display_scale.mV[VX] - (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mY * display_scale.mV[VY] + (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mX * display_scale.mV[VX] + 10.f),
llround((F32)mMousePt.mY * display_scale.mV[VY] + (F32)(PICK_DIAMETER) * 10.f + 10.f));
gl_line_2d(llround((F32)mMousePt.mX * display_scale.mV[VX] + (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mY * display_scale.mV[VY] - (F32)(PICK_HALF_WIDTH)),
llround((F32)mMousePt.mX * display_scale.mV[VX] + (F32)(PICK_DIAMETER) * 10.f + 10.f),
llround((F32)mMousePt.mY * display_scale.mV[VY] + 10.f));
gGL.translatef(10.f, 10.f, 0.f);
gl_rect_2d(llround((F32)mPickPt.mX * display_scale.mV[VX]),
llround((F32)mPickPt.mY * display_scale.mV[VY] + (F32)(PICK_DIAMETER) * 10.f),
llround((F32)mPickPt.mX * display_scale.mV[VX] + (F32)(PICK_DIAMETER) * 10.f),
llround((F32)mPickPt.mY * display_scale.mV[VY]),
FALSE);
gl_rect_2d(llround((F32)mPickPt.mX * display_scale.mV[VX]),
llround((F32)mPickPt.mY * display_scale.mV[VY] + 10.f),
llround((F32)mPickPt.mX * display_scale.mV[VX] + 10.f),
llround((F32)mPickPt.mY * display_scale.mV[VY]),
FALSE);
gGL.popMatrix();
}
}
void LLPickInfo::getSurfaceInfo()
{
// set values to uninitialized - this is what we return if no intersection is found

View File

@@ -85,18 +85,15 @@ public:
public:
LLPickInfo();
LLPickInfo(const LLCoordGL& mouse_pos,
const LLRect& screen_region,
MASK keyboard_mask,
BOOL pick_transparent,
BOOL pick_surface_info,
void (*pick_callback)(const LLPickInfo& pick_info));
~LLPickInfo();
void fetchResults();
LLPointer<LLViewerObject> getObject() const;
LLUUID getObjectID() const { return mObjectID; }
bool isValid() const { return mPickType != PICK_INVALID; }
void drawPickBuffer() const;
static bool isFlora(LLViewerObject* object);
@@ -119,16 +116,12 @@ public:
LLVector3 mNormal;
LLVector3 mBinormal;
BOOL mPickTransparent;
LLRect mScreenRegion;
void getSurfaceInfo();
private:
void updateXYCoords();
BOOL mWantSurfaceInfo; // do we populate mUVCoord, mNormal, mBinormal?
U8 mPickBuffer[PICK_DIAMETER * PICK_DIAMETER * 4];
F32 mPickDepthBuffer[PICK_DIAMETER * PICK_DIAMETER];
BOOL mPickParcelWall;
};
@@ -384,8 +377,6 @@ public:
const LLVector2& getDisplayScale() const { return mDisplayScale; }
void calcDisplayScale();
void drawPickBuffer() const;
private:
bool shouldShowToolTipFor(LLMouseHandler *mh);
static bool onAlert(const LLSD& notify);
@@ -498,8 +489,6 @@ extern LLFrameTimer gMouseIdleTimer; // how long has it been since the mouse l
extern LLFrameTimer gAwayTimer; // tracks time before setting the avatar away state to true
extern LLFrameTimer gAwayTriggerTimer; // how long the avatar has been away
extern BOOL gDebugSelect;
extern BOOL gDebugFastUIRender;
extern LLViewerObject* gDebugRaycastObject;
extern LLVector3 gDebugRaycastIntersection;

View File

@@ -5132,7 +5132,12 @@ void LLVOAvatar::updateTextures()
}
else
{
render_avatar = isVisible() && !mCulled;
if(!isVisible())
{
return ;//do not update for invisible avatar.
}
render_avatar = !mCulled; //visible and not culled.
}
std::vector<bool> layer_baked;
@@ -5799,19 +5804,6 @@ void LLVOAvatar::resetSpecificJointPosition( const std::string& name )
//-----------------------------------------------------------------------------
void LLVOAvatar::resetJointPositionsToDefault( void )
{
const LLVector3& avPos = getCharacterPosition();
//Reposition the pelvis
LLJoint* pPelvis = mRoot.findJoint("mPelvis");
if ( pPelvis )
{
pPelvis->setPosition( avPos + pPelvis->getPosition() );
}
else
{
llwarns<<"Can't get pelvis joint."<<llendl;
return;
}
//Subsequent joints are relative to pelvis
for( S32 i = 0; i < (S32)mNumJoints; ++i )
@@ -5822,7 +5814,7 @@ void LLVOAvatar::resetJointPositionsToDefault( void )
pJoint->setId( LLUUID::null );
//restore joints to default positions, however skip over the pelvis
if ( pJoint && pPelvis != pJoint )
if ( pJoint )
{
pJoint->restoreOldXform();
}
@@ -6165,7 +6157,8 @@ BOOL LLVOAvatar::loadSkeletonNode ()
mRoot.addChild( &mSkeleton[0] );
for (std::vector<LLViewerJoint *>::iterator iter = mMeshLOD.begin();
iter != mMeshLOD.end(); iter++)
iter != mMeshLOD.end();
++iter)
{
LLViewerJoint *joint = (LLViewerJoint *) *iter;
joint->mUpdateXform = FALSE;
@@ -6201,7 +6194,8 @@ BOOL LLVOAvatar::loadSkeletonNode ()
{
LLVOAvatarXmlInfo::skeletal_distortion_info_list_t::iterator iter;
for (iter = sAvatarXmlInfo->mSkeletalDistortionInfoList.begin();
iter != sAvatarXmlInfo->mSkeletalDistortionInfoList.end(); iter++)
iter != sAvatarXmlInfo->mSkeletalDistortionInfoList.end();
++iter)
{
LLPolySkeletalDistortionInfo *info = *iter;
LLPolySkeletalDistortion *param = new LLPolySkeletalDistortion(this);
@@ -6221,7 +6215,8 @@ BOOL LLVOAvatar::loadSkeletonNode ()
{
LLVOAvatarXmlInfo::attachment_info_list_t::iterator iter;
for (iter = sAvatarXmlInfo->mAttachmentInfoList.begin();
iter != sAvatarXmlInfo->mAttachmentInfoList.end(); iter++)
iter != sAvatarXmlInfo->mAttachmentInfoList.end();
++iter)
{
LLVOAvatarXmlInfo::LLVOAvatarAttachmentInfo *info = *iter;
if (!isSelf() && info->mJointName == "mScreen")
@@ -6301,8 +6296,8 @@ BOOL LLVOAvatar::loadSkeletonNode ()
BOOL LLVOAvatar::loadMeshNodes()
{
for (LLVOAvatarXmlInfo::mesh_info_list_t::const_iterator meshinfo_iter = sAvatarXmlInfo->mMeshInfoList.begin();
meshinfo_iter != sAvatarXmlInfo->mMeshInfoList.end();
meshinfo_iter++)
meshinfo_iter != sAvatarXmlInfo->mMeshInfoList.end();
++meshinfo_iter)
{
const LLVOAvatarXmlInfo::LLVOAvatarMeshInfo *info = *meshinfo_iter;
const std::string &type = info->mType;
@@ -6318,7 +6313,7 @@ BOOL LLVOAvatar::loadMeshNodes()
mesh = &mHairMesh0; */
for (LLVOAvatarDictionary::Meshes::const_iterator mesh_iter = LLVOAvatarDictionary::getInstance()->getMeshes().begin();
mesh_iter != LLVOAvatarDictionary::getInstance()->getMeshes().end();
mesh_iter++)
++mesh_iter)
{
const EMeshIndex mesh_index = mesh_iter->first;
const LLVOAvatarDictionary::MeshEntry *mesh_dict = mesh_iter->second;
@@ -6389,8 +6384,8 @@ BOOL LLVOAvatar::loadMeshNodes()
mesh->setLOD( info->mMinPixelArea );
for (LLVOAvatarXmlInfo::LLVOAvatarMeshInfo::morph_info_list_t::const_iterator xmlinfo_iter = info->mPolyMorphTargetInfoList.begin();
xmlinfo_iter != info->mPolyMorphTargetInfoList.end();
xmlinfo_iter++)
xmlinfo_iter != info->mPolyMorphTargetInfoList.end();
++xmlinfo_iter)
{
const LLVOAvatarXmlInfo::LLVOAvatarMeshInfo::morph_info_pair_t *info_pair = &(*xmlinfo_iter);
LLPolyMorphTarget *param = new LLPolyMorphTarget(mesh->getMesh());
@@ -7033,6 +7028,14 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
if ( bindCnt > 0 )
{
LLVOAvatar::resetJointPositionsToDefault();
//Need to handle the repositioning of the cam, updating rig data etc during outfit editing
//This handles the case where we detach a replacement rig.
if ( gAgentCamera.cameraCustomizeAvatar() )
{
gAgent.unpauseAnimation();
//Still want to refocus on head bone
gAgentCamera.changeCameraToCustomizeAvatar();
}
}
}
}
@@ -7046,12 +7049,12 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
{
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end(); )
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
{
attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
// only one object per attachment point for now
LLViewerJointAttachment* attachment = iter->second;
if (attachment->isObjectAttached(viewer_object))
{
// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
@@ -7069,7 +7072,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
}
}
// [/RLVa:KB]
cleanupAttachedMesh( viewer_object );
LLUUID item_id = viewer_object->getAttachmentItemID();
attachment->removeObject(viewer_object);
if (isSelf())
@@ -7606,20 +7609,18 @@ void LLVOAvatar::invalidateAll()
updateMeshTextures();
}
void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL set_by_user )
void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake )
{
if (global_color == mTexSkinColor)
{
// llinfos << "invalidateComposite cause: onGlobalColorChanged( skin color )" << llendl;
invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, set_by_user );
invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, set_by_user );
invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, set_by_user );
invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake );
invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake );
invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake );
}
else if (global_color == mTexHairColor)
{
// llinfos << "invalidateComposite cause: onGlobalColorChanged( hair color )" << llendl;
invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, set_by_user );
invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet, set_by_user );
invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake );
invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet, upload_bake );
// ! BACKWARDS COMPATIBILITY !
// Fix for dealing with avatars from viewers that don't bake hair.
@@ -7631,11 +7632,11 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
mBakedTextureDatas[BAKED_HAIR].mMeshes[i]->setColor( color.mV[VX], color.mV[VY], color.mV[VZ], color.mV[VW] );
}
}
}
}
else if (global_color == mTexEyeColor)
{
// llinfos << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << llendl;
invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, set_by_user );
invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, upload_bake );
}
updateMeshTextures();
}
@@ -8728,14 +8729,14 @@ BOOL LLVOAvatar::teToColorParams( ETextureIndex te, const char* param_name[3] )
return TRUE;
}
void LLVOAvatar::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL set_by_user )
void LLVOAvatar::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake )
{
const char* param_name[3];
if( teToColorParams( te, param_name ) )
{
setVisualParamWeight( param_name[0], new_color.mV[VX], set_by_user );
setVisualParamWeight( param_name[1], new_color.mV[VY], set_by_user );
setVisualParamWeight( param_name[2], new_color.mV[VZ], set_by_user );
setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake );
setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake );
setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake );
}
}
@@ -8752,8 +8753,11 @@ LLColor4 LLVOAvatar::getClothesColor( ETextureIndex te )
return color;
}
// static
LLColor4 LLVOAvatar::getDummyColor()
{
return DUMMY_COLOR;
}
void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const
{
@@ -8765,31 +8769,31 @@ void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const
iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
++iter)
{
const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second;
const LLViewerTexture* te_image = getTEImage(iter->first);
if( !te_image )
{
llinfos << " " << text_dict->mName << ": null ptr" << llendl;
llinfos << " " << texture_dict->mName << ": null ptr" << llendl;
}
else if( te_image->getID().isNull() )
{
llinfos << " " << text_dict->mName << ": null UUID" << llendl;
llinfos << " " << texture_dict->mName << ": null UUID" << llendl;
}
else if( te_image->getID() == IMG_DEFAULT )
{
llinfos << " " << text_dict->mName << ": IMG_DEFAULT" << llendl;
llinfos << " " << texture_dict->mName << ": IMG_DEFAULT" << llendl;
}
else if (te_image->getID() == IMG_INVISIBLE)
{
llinfos << " " << text_dict->mName << ": IMG_INVISIBLE" << llendl;
llinfos << " " << texture_dict->mName << ": IMG_INVISIBLE" << llendl;
}
else if( te_image->getID() == IMG_DEFAULT_AVATAR )
{
llinfos << " " << text_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl;
llinfos << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl;
}
else
{
llinfos << " " << text_dict->mName << ": " << te_image->getID() << llendl;
llinfos << " " << texture_dict->mName << ": " << te_image->getID() << llendl;
}
}
}
@@ -8850,11 +8854,6 @@ void LLVOAvatar::setInvisible(BOOL newvalue)
}
}
LLColor4 LLVOAvatar::getDummyColor()
{
return DUMMY_COLOR;
}
// Unlike most wearable functions, this works for both self and other.
BOOL LLVOAvatar::isWearingWearableType( LLWearableType::EType type ) const
{
@@ -9528,7 +9527,7 @@ void LLVOAvatar::dumpArchetypeXML( void* )
const std::string& wearable_name = LLWearableType::getTypeName( (LLWearableType::EType) type );
apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() );
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
for( LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam() )
{
LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
if( (viewer_param->getWearableType() == type) &&
@@ -10274,9 +10273,7 @@ std::string LLVOAvatar::getFullname() const
LLNameValue* last = getNVPair("LastName");
if (first && last)
{
name += first->getString();
name += " ";
name += last->getString();
name = LLCacheName::buildFullName( first->getString(), last->getString() );
}
return name;
@@ -10523,10 +10520,10 @@ const std::string LLVOAvatar::getBakedStatusForPrintout() const
++iter)
{
const ETextureIndex index = iter->first;
const LLVOAvatarDictionary::TextureEntry *text_dict = iter->second;
if (text_dict->mIsBakedTexture)
const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second;
if (texture_dict->mIsBakedTexture)
{
line += text_dict->mName;
line += texture_dict->mName;
if (isTextureDefined(index))
{
line += "_baked";

View File

@@ -279,9 +279,6 @@ public:
F32 getFogDensity(void);
LLColor4 getFogColor(void);
// singleton pattern implementation
static LLWaterParamManager * instance();
public:
LLWaterParamSet mCurParams;
@@ -323,7 +320,7 @@ private:
// list of all the parameters, listed by name
std::map<std::string, LLWaterParamSet> mParamList;
preset_map_t mParamList;
std::vector<LLGLSLShader *> mShaderList;
};