Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
commit
3ec5110129
|
|
@ -1276,7 +1276,6 @@ bool LLAppViewer::init()
|
|||
|
||||
//LLSimpleton creations
|
||||
LLEnvironment::createInstance();
|
||||
LLEnvironment::getInstance()->initSingleton();
|
||||
LLWorld::createInstance();
|
||||
LLSelectMgr::createInstance();
|
||||
LLViewerCamera::createInstance();
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "lldrawable.h"
|
||||
#include "llface.h"
|
||||
#include "llsky.h"
|
||||
#include "llstartup.h"
|
||||
#include "lltextureentry.h"
|
||||
#include "llviewercamera.h"
|
||||
#include "llviewertexturelist.h"
|
||||
|
|
@ -79,11 +80,6 @@ static S32 bump_channel = -1;
|
|||
|
||||
#define LL_BUMPLIST_MULTITHREADED 0 // TODO -- figure out why this doesn't work
|
||||
|
||||
// static
|
||||
void LLStandardBumpmap::init()
|
||||
{
|
||||
LLStandardBumpmap::restoreGL();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLStandardBumpmap::shutdown()
|
||||
|
|
@ -94,7 +90,7 @@ void LLStandardBumpmap::shutdown()
|
|||
// static
|
||||
void LLStandardBumpmap::restoreGL()
|
||||
{
|
||||
addstandard();
|
||||
addstandard();
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -107,6 +103,12 @@ void LLStandardBumpmap::addstandard()
|
|||
return ;
|
||||
}
|
||||
|
||||
if (LLStartUp::getStartupState() < STATE_SEED_CAP_GRANTED)
|
||||
{
|
||||
// Not ready, need caps for images
|
||||
return;
|
||||
}
|
||||
|
||||
// can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup. Sigh. So clear the list every time before we (re-)add the standard bumpmaps.
|
||||
//llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 );
|
||||
clear();
|
||||
|
|
@ -786,8 +788,6 @@ void LLBumpImageList::init()
|
|||
llassert( mBrightnessEntries.size() == 0 );
|
||||
llassert( mDarknessEntries.size() == 0 );
|
||||
|
||||
LLStandardBumpmap::init();
|
||||
|
||||
LLStandardBumpmap::restoreGL();
|
||||
sMainQueue = LL::WorkQueue::getInstance("mainloop");
|
||||
sTexUpdateQueue = LL::WorkQueue::getInstance("LLImageGL"); // Share work queue with tex loader.
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ public:
|
|||
static void clear();
|
||||
static void addstandard();
|
||||
|
||||
static void init();
|
||||
static void shutdown();
|
||||
static void restoreGL();
|
||||
static void destroyGL();
|
||||
|
|
|
|||
|
|
@ -874,26 +874,37 @@ void LLEnvironment::initSingleton()
|
|||
|
||||
requestRegion();
|
||||
|
||||
gAgent.addParcelChangedCallback([this]() { onParcelChange(); });
|
||||
if (!mParcelCallbackConnection.connected())
|
||||
{
|
||||
mParcelCallbackConnection = gAgent.addParcelChangedCallback([this]() { onParcelChange(); });
|
||||
|
||||
//TODO: This frequently results in one more request than we need. It isn't breaking, but should be nicer.
|
||||
// We need to know new env version to fix this, without it we can only do full re-request
|
||||
// Happens: on updates, on opening LLFloaterRegionInfo, on region crossing if info floater is open
|
||||
LLRegionInfoModel::instance().setUpdateCallback([this]() { requestRegion(); });
|
||||
gAgent.addRegionChangedCallback([this]() { onRegionChange(); });
|
||||
//TODO: This frequently results in one more request than we need. It isn't breaking, but should be nicer.
|
||||
// We need to know new env version to fix this, without it we can only do full re-request
|
||||
// Happens: on updates, on opening LLFloaterRegionInfo, on region crossing if info floater is open
|
||||
mRegionUpdateCallbackConnection = LLRegionInfoModel::instance().setUpdateCallback([this]() { requestRegion(); });
|
||||
mRegionChangeCallbackConnection = gAgent.addRegionChangedCallback([this]() { onRegionChange(); });
|
||||
|
||||
gAgent.whenPositionChanged([this](const LLVector3 &localpos, const LLVector3d &) { onAgentPositionHasChanged(localpos); });
|
||||
mPositionCallbackConnection = gAgent.whenPositionChanged([this](const LLVector3 &localpos, const LLVector3d &) { onAgentPositionHasChanged(localpos); });
|
||||
}
|
||||
|
||||
if (!gGenericDispatcher.isHandlerPresent(MESSAGE_PUSHENVIRONMENT))
|
||||
{
|
||||
gGenericDispatcher.addHandler(MESSAGE_PUSHENVIRONMENT, &environment_push_dispatch_handler);
|
||||
}
|
||||
|
||||
LLEventPumps::instance().obtain(PUMP_EXPERIENCE).stopListening(LISTENER_NAME);
|
||||
LLEventPumps::instance().obtain(PUMP_EXPERIENCE).listen(LISTENER_NAME, [this](LLSD message) { listenExperiencePump(message); return false; });
|
||||
}
|
||||
|
||||
void LLEnvironment::cleanupSingleton()
|
||||
{
|
||||
if (mParcelCallbackConnection.connected())
|
||||
{
|
||||
mParcelCallbackConnection.disconnect();
|
||||
mRegionUpdateCallbackConnection.disconnect();
|
||||
mRegionChangeCallbackConnection.disconnect();
|
||||
mPositionCallbackConnection.disconnect();
|
||||
}
|
||||
LLEventPumps::instance().obtain(PUMP_EXPERIENCE).stopListening(LISTENER_NAME);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -402,6 +402,11 @@ private:
|
|||
bool mShowMoonBeacon;
|
||||
S32 mEditorCounter;
|
||||
|
||||
connection_t mParcelCallbackConnection;
|
||||
connection_t mRegionUpdateCallbackConnection;
|
||||
connection_t mRegionChangeCallbackConnection;
|
||||
connection_t mPositionCallbackConnection;
|
||||
|
||||
struct UpdateInfo
|
||||
{
|
||||
typedef std::shared_ptr<UpdateInfo> ptr_t;
|
||||
|
|
|
|||
|
|
@ -1435,6 +1435,9 @@ bool idle_startup()
|
|||
// to hapen with caps granted
|
||||
gTextureList.doPrefetchImages();
|
||||
|
||||
// will init images, should be done with caps, but before gSky.init()
|
||||
LLEnvironment::getInstance()->initSingleton();
|
||||
|
||||
display_startup();
|
||||
update_texture_fetch();
|
||||
display_startup();
|
||||
|
|
@ -2918,6 +2921,7 @@ void reset_login()
|
|||
gAgentWearables.cleanup();
|
||||
gAgentCamera.cleanup();
|
||||
gAgent.cleanup();
|
||||
gSky.cleanup(); // mVOSkyp is an inworld object.
|
||||
LLWorld::getInstance()->resetClass();
|
||||
|
||||
if ( gViewerWindow )
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include "llxmltree.h"
|
||||
#include "message.h"
|
||||
|
||||
#include "lldrawpoolbump.h" // to init bumpmap images
|
||||
#include "lltexturecache.h"
|
||||
#include "lltexturefetch.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
|
@ -135,9 +136,6 @@ void LLViewerTextureList::doPreloadImages()
|
|||
//uv_test->setClamp(FALSE, FALSE);
|
||||
//uv_test->setMipFilterNearest(TRUE, TRUE);
|
||||
|
||||
// prefetch specific UUIDs
|
||||
LLViewerTextureManager::getFetchedTexture(IMG_SHOT);
|
||||
LLViewerTextureManager::getFetchedTexture(IMG_SMOKE_POOF);
|
||||
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTextureFromFile("silhouette.j2c", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI);
|
||||
if (image)
|
||||
{
|
||||
|
|
@ -206,13 +204,26 @@ void LLViewerTextureList::doPrefetchImages()
|
|||
{
|
||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
|
||||
|
||||
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL, FTT_DEFAULT, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI);
|
||||
if (imagep)
|
||||
// todo: do not load without getViewerAssetUrl()
|
||||
// either fail login without caps or provide this
|
||||
// in some other way, textures won't load otherwise
|
||||
LLViewerFetchedTexture *imagep = findImage(DEFAULT_WATER_NORMAL, TEX_LIST_STANDARD);
|
||||
if (!imagep)
|
||||
{
|
||||
imagep->setAddressMode(LLTexUnit::TAM_WRAP);
|
||||
mImagePreloads.insert(imagep);
|
||||
// add it to mImagePreloads only once
|
||||
imagep = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL, FTT_DEFAULT, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI);
|
||||
if (imagep)
|
||||
{
|
||||
imagep->setAddressMode(LLTexUnit::TAM_WRAP);
|
||||
mImagePreloads.insert(imagep);
|
||||
}
|
||||
}
|
||||
|
||||
LLViewerTextureManager::getFetchedTexture(IMG_SHOT);
|
||||
LLViewerTextureManager::getFetchedTexture(IMG_SMOKE_POOF);
|
||||
|
||||
LLStandardBumpmap::addstandard();
|
||||
|
||||
if (LLAppViewer::instance()->getPurgeCache())
|
||||
{
|
||||
// cache was purged, no point
|
||||
|
|
|
|||
Loading…
Reference in New Issue