Auto deruth, backport from 2.x
This commit is contained in:
@@ -68,9 +68,10 @@
|
||||
#include "lltexlayer.h"
|
||||
#include "lltoolgrab.h" // for needsRenderBeam
|
||||
#include "lltoolmgr.h" // for needsRenderBeam
|
||||
#include "lltoolmorph.h"
|
||||
#include "lltoolmorph.h" // for auto deruth
|
||||
#include "llviewercamera.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewergenericmessage.h"
|
||||
#include "llviewerimagelist.h"
|
||||
#include "llviewermedia.h"
|
||||
#include "llviewermenu.h"
|
||||
@@ -881,6 +882,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
||||
mOohMorph = NULL;
|
||||
mAahMorph = NULL;
|
||||
|
||||
mRuthTimer.reset();
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// initialize joint, mesh and shape members
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -7755,7 +7758,9 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
|
||||
{
|
||||
loading = TRUE;
|
||||
}
|
||||
|
||||
|
||||
updateRuthTimer(loading);
|
||||
|
||||
// special case to keep nudity off orientation island -
|
||||
// this is fragilely dependent on the compositing system,
|
||||
// which gets available textures in the following order:
|
||||
@@ -7784,6 +7789,8 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// we wait a little bit before giving the all clear,
|
||||
// to let textures settle down
|
||||
@@ -7809,13 +7816,41 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
|
||||
}
|
||||
|
||||
|
||||
void LLVOAvatar::updateRuthTimer(bool loading)
|
||||
{
|
||||
if (isSelf() || !loading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mPreviousFullyLoaded)
|
||||
{
|
||||
mRuthTimer.reset();
|
||||
}
|
||||
|
||||
const F32 LOADING_TIMEOUT__SECONDS = 30.f;
|
||||
if (mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT__SECONDS)
|
||||
{
|
||||
llinfos << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' "
|
||||
<< "( Params loaded : " << !visualParamWeightsAreDefault() << " ) "
|
||||
<< "( Lower : " << isTextureDefined(TEX_LOWER_BAKED) << " ) "
|
||||
<< "( Upper : " << isTextureDefined(TEX_UPPER_BAKED) << " ) "
|
||||
<< "( Head : " << isTextureDefined(TEX_HEAD_BAKED) << " )."
|
||||
<< llendl;
|
||||
|
||||
//LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID());
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back(getID().asString());
|
||||
send_generic_message("avatartexturesrequest", strings);
|
||||
mRuthTimer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL LLVOAvatar::isFullyLoaded()
|
||||
{
|
||||
/* WHY WOULD YOU DO THIS -HgB
|
||||
if (gSavedSettings.getBOOL("RenderUnloadedAvatar"))
|
||||
return TRUE;
|
||||
else*/
|
||||
else
|
||||
return mFullyLoaded;
|
||||
}
|
||||
|
||||
@@ -9136,6 +9171,23 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
|
||||
else
|
||||
{
|
||||
llwarns << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl;
|
||||
const F32 LOADING_TIMEOUT_SECONDS = 20.f;
|
||||
// this isn't really a problem if we already have a non-default shape
|
||||
if (visualParamWeightsAreDefault() && mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT_SECONDS)
|
||||
{
|
||||
// re-request appearance, hoping that it comes back with a shape next time
|
||||
llinfos << "Re-requesting AvatarAppearance for object: " << getID() << llendl;
|
||||
//LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID());
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back(getID().asString());
|
||||
send_generic_message("avatartexturesrequest", strings);
|
||||
mRuthTimer.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "That's okay, we already have a non-default shape for object: " << getID() << llendl;
|
||||
// we don't really care.
|
||||
}
|
||||
}
|
||||
|
||||
setCompositeUpdatesEnabled( TRUE );
|
||||
|
||||
@@ -388,12 +388,15 @@ public:
|
||||
BOOL isFullyLoaded();
|
||||
//BOOL isReallyFullyLoaded();
|
||||
BOOL updateIsFullyLoaded();
|
||||
protected:
|
||||
void updateRuthTimer(bool loading);
|
||||
private:
|
||||
BOOL mFullyLoaded;
|
||||
BOOL mPreviousFullyLoaded;
|
||||
BOOL mFullyLoadedInitialized;
|
||||
S32 mFullyLoadedFrameCounter;
|
||||
LLFrameTimer mFullyLoadedTimer;
|
||||
LLFrameTimer mRuthTimer;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Collision Volumes
|
||||
|
||||
Reference in New Issue
Block a user