Auto deruth, backport from 2.x
This commit is contained in:
@@ -68,9 +68,10 @@
|
|||||||
#include "lltexlayer.h"
|
#include "lltexlayer.h"
|
||||||
#include "lltoolgrab.h" // for needsRenderBeam
|
#include "lltoolgrab.h" // for needsRenderBeam
|
||||||
#include "lltoolmgr.h" // for needsRenderBeam
|
#include "lltoolmgr.h" // for needsRenderBeam
|
||||||
#include "lltoolmorph.h"
|
#include "lltoolmorph.h" // for auto deruth
|
||||||
#include "llviewercamera.h"
|
#include "llviewercamera.h"
|
||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
|
#include "llviewergenericmessage.h"
|
||||||
#include "llviewerimagelist.h"
|
#include "llviewerimagelist.h"
|
||||||
#include "llviewermedia.h"
|
#include "llviewermedia.h"
|
||||||
#include "llviewermenu.h"
|
#include "llviewermenu.h"
|
||||||
@@ -881,6 +882,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||||||
mOohMorph = NULL;
|
mOohMorph = NULL;
|
||||||
mAahMorph = NULL;
|
mAahMorph = NULL;
|
||||||
|
|
||||||
|
mRuthTimer.reset();
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// initialize joint, mesh and shape members
|
// initialize joint, mesh and shape members
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -7756,6 +7759,8 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
|
|||||||
loading = TRUE;
|
loading = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateRuthTimer(loading);
|
||||||
|
|
||||||
// special case to keep nudity off orientation island -
|
// special case to keep nudity off orientation island -
|
||||||
// this is fragilely dependent on the compositing system,
|
// this is fragilely dependent on the compositing system,
|
||||||
// which gets available textures in the following order:
|
// which gets available textures in the following order:
|
||||||
@@ -7785,6 +7790,8 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// we wait a little bit before giving the all clear,
|
// we wait a little bit before giving the all clear,
|
||||||
// to let textures settle down
|
// to let textures settle down
|
||||||
const F32 PAUSE = 1.f;
|
const F32 PAUSE = 1.f;
|
||||||
@@ -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()
|
BOOL LLVOAvatar::isFullyLoaded()
|
||||||
{
|
{
|
||||||
/* WHY WOULD YOU DO THIS -HgB
|
|
||||||
if (gSavedSettings.getBOOL("RenderUnloadedAvatar"))
|
if (gSavedSettings.getBOOL("RenderUnloadedAvatar"))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else*/
|
else
|
||||||
return mFullyLoaded;
|
return mFullyLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9136,6 +9171,23 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
llwarns << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl;
|
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 );
|
setCompositeUpdatesEnabled( TRUE );
|
||||||
|
|||||||
@@ -388,12 +388,15 @@ public:
|
|||||||
BOOL isFullyLoaded();
|
BOOL isFullyLoaded();
|
||||||
//BOOL isReallyFullyLoaded();
|
//BOOL isReallyFullyLoaded();
|
||||||
BOOL updateIsFullyLoaded();
|
BOOL updateIsFullyLoaded();
|
||||||
|
protected:
|
||||||
|
void updateRuthTimer(bool loading);
|
||||||
private:
|
private:
|
||||||
BOOL mFullyLoaded;
|
BOOL mFullyLoaded;
|
||||||
BOOL mPreviousFullyLoaded;
|
BOOL mPreviousFullyLoaded;
|
||||||
BOOL mFullyLoadedInitialized;
|
BOOL mFullyLoadedInitialized;
|
||||||
S32 mFullyLoadedFrameCounter;
|
S32 mFullyLoadedFrameCounter;
|
||||||
LLFrameTimer mFullyLoadedTimer;
|
LLFrameTimer mFullyLoadedTimer;
|
||||||
|
LLFrameTimer mRuthTimer;
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Collision Volumes
|
// Collision Volumes
|
||||||
|
|||||||
Reference in New Issue
Block a user