summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llstartup.cpp9
-rw-r--r--indra/newview/lltexturefetch.cpp12
-rw-r--r--indra/newview/llviewertexturelist.cpp27
-rw-r--r--indra/newview/llviewertexturelist.h2
4 files changed, 36 insertions, 14 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 64dd3af223..548f6fd6d2 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1286,9 +1286,6 @@ bool idle_startup()
// Initialize classes w/graphics stuff.
//
LLViewerStatsRecorder::instance(); // Since textures work in threads
- gTextureList.doPrefetchImages();
- display_startup();
-
LLSurface::initClasses();
display_startup();
@@ -1433,6 +1430,12 @@ bool idle_startup()
if (STATE_SEED_CAP_GRANTED == LLStartUp::getStartupState())
{
display_startup();
+
+ // These textures are not warrantied to be cached, so needs
+ // to hapen with caps granted
+ gTextureList.doPrefetchImages();
+
+ display_startup();
update_texture_fetch();
display_startup();
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 987918fc1d..7cccd6f5ac 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -1291,10 +1291,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
if ( use_http && mCanUseHTTP && mUrl.empty())//get http url.
{
LLViewerRegion* region = NULL;
- if (mHost.isInvalid())
- region = gAgent.getRegion();
- else
- region = LLWorld::getInstance()->getRegion(mHost);
+ if (mHost.isInvalid())
+ {
+ region = gAgent.getRegion();
+ }
+ else if (LLWorld::instanceExists())
+ {
+ region = LLWorld::getInstance()->getRegion(mHost);
+ }
if (region)
{
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 7445475360..55a735e906 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -50,6 +50,7 @@
#include "llviewercontrol.h"
#include "llviewertexture.h"
#include "llviewermedia.h"
+#include "llviewernetwork.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "pipeline.h"
@@ -155,12 +156,6 @@ void LLViewerTextureList::doPreloadImages()
image->setAddressMode(LLTexUnit::TAM_WRAP);
mImagePreloads.insert(image);
}
- image = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL, FTT_DEFAULT, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI);
- if (image)
- {
- image->setAddressMode(LLTexUnit::TAM_WRAP);
- mImagePreloads.insert(image);
- }
image = LLViewerTextureManager::getFetchedTextureFromFile("transparent.j2c", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE,
0, 0, IMG_TRANSPARENT);
if (image)
@@ -193,13 +188,31 @@ void LLViewerTextureList::doPreloadImages()
static std::string get_texture_list_name()
{
- return gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "texture_list_" + gSavedSettings.getString("LoginLocation") + "." + gDirUtilp->getUserName() + ".xml");
+ if (LLGridManager::getInstance()->isInProductionGrid())
+ {
+ return gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
+ "texture_list_" + gSavedSettings.getString("LoginLocation") + "." + gDirUtilp->getUserName() + ".xml");
+ }
+ else
+ {
+ const std::string& grid_id_str = LLGridManager::getInstance()->getGridId();
+ const std::string& grid_id_lower = utf8str_tolower(grid_id_str);
+ return gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
+ "texture_list_" + gSavedSettings.getString("LoginLocation") + "." + gDirUtilp->getUserName() + "." + grid_id_lower + ".xml");
+ }
}
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)
+ {
+ imagep->setAddressMode(LLTexUnit::TAM_WRAP);
+ mImagePreloads.insert(imagep);
+ }
+
if (LLAppViewer::instance()->getPurgeCache())
{
// cache was purged, no point
diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h
index b921225e39..454574f7d6 100644
--- a/indra/newview/llviewertexturelist.h
+++ b/indra/newview/llviewertexturelist.h
@@ -127,7 +127,9 @@ public:
S32 getNumImages() { return mImageList.size(); }
+ // Local UI images
void doPreloadImages();
+ // Network images. Needs caps and cache to work
void doPrefetchImages();
void clearFetchingRequests();