summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2010-09-16 20:09:36 -0700
committerMerov Linden <merov@lindenlab.com>2010-09-16 20:09:36 -0700
commit8ada6ed3cf562d33cc66f2a5d664b5e1f40e1f0c (patch)
treea6430d873ca02f5cee683c95a3a4747c16f8aace /indra/newview/llappviewer.cpp
parent657f75b89de4cfd5ade82e3bc30e236cd2533017 (diff)
parent30c8979e157a4503509360f0c70d609eb97d6db9 (diff)
Pull update from viewer-development
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp51
1 files changed, 32 insertions, 19 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index d383c9adbc..5e75237180 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -929,8 +929,9 @@ bool LLAppViewer::init()
//EXT-7013 - On windows for some locale (Japanese) standard
//datetime formatting functions didn't support some parameters such as "weekday".
+ //Names for days and months localized in xml are also useful for Polish locale(STORM-107).
std::string language = LLControlGroup::getInstance(sGlobalSettingsName)->getString("Language");
- if(language == "ja")
+ if(language == "ja" || language == "pl")
{
LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames"));
LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames"));
@@ -3026,14 +3027,6 @@ void LLAppViewer::migrateCacheDirectory()
#endif // LL_WINDOWS || LL_DARWIN
}
-//static
-S32 LLAppViewer::getCacheVersion()
-{
- static const S32 cache_version = 7;
-
- return cache_version ;
-}
-
void dumpVFSCaches()
{
llinfos << "======= Static VFS ========" << llendl;
@@ -3072,23 +3065,40 @@ void dumpVFSCaches()
SetCurrentDirectory(w_str);
#endif
}
+
+//static
+U32 LLAppViewer::getTextureCacheVersion()
+{
+ //viewer texture cache version, change if the texture cache format changes.
+ const U32 TEXTURE_CACHE_VERSION = 7;
+
+ return TEXTURE_CACHE_VERSION ;
+}
+
+//static
+U32 LLAppViewer::getObjectCacheVersion()
+{
+ // Viewer object cache version, change if object update
+ // format changes. JC
+ const U32 INDRA_OBJECT_CACHE_VERSION = 14;
+
+ return INDRA_OBJECT_CACHE_VERSION;
+}
+
bool LLAppViewer::initCache()
{
mPurgeCache = false;
- BOOL disable_texture_cache = FALSE ;
BOOL read_only = mSecondInstance ? TRUE : FALSE;
LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
+ LLVOCache::getInstance()->setReadOnly(read_only);
- if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getCacheVersion())
+ BOOL texture_cache_mismatch = FALSE ;
+ if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion())
{
- if(read_only)
+ texture_cache_mismatch = TRUE ;
+ if(!read_only)
{
- disable_texture_cache = TRUE ; //if the cache version of this viewer is different from the running one, this viewer can not use the texture cache.
- }
- else
- {
- mPurgeCache = true; // Purge cache if the version number is different.
- gSavedSettings.setS32("LocalCacheVersion", LLAppViewer::getCacheVersion());
+ gSavedSettings.setS32("LocalCacheVersion", LLAppViewer::getTextureCacheVersion());
}
}
@@ -3139,9 +3149,11 @@ bool LLAppViewer::initCache()
const S64 MAX_CACHE_SIZE = 1024*MB;
cache_size = llmin(cache_size, MAX_CACHE_SIZE);
S64 texture_cache_size = ((cache_size * 8)/10);
- S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, disable_texture_cache);
+ S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch);
texture_cache_size -= extra;
+ LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()) ;
+
LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS"));
// Init the VFS
@@ -3304,6 +3316,7 @@ void LLAppViewer::purgeCache()
{
LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl;
LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
+ LLVOCache::getInstance()->removeCache(LL_PATH_CACHE);
std::string mask = gDirUtilp->getDirDelimiter() + "*.*";
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask);
}