summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llappviewer.cpp73
-rw-r--r--indra/newview/llappviewer.h2
-rw-r--r--indra/newview/lltexturecache.cpp59
-rw-r--r--indra/newview/lltexturecache.h3
-rw-r--r--indra/newview/skins/default/xui/en/floater_hardware_settings.xml22
-rw-r--r--indra/newview/skins/default/xui/es/floater_land_holdings.xml2
-rw-r--r--indra/newview/skins/default/xui/es/menu_viewer.xml2
-rw-r--r--indra/newview/skins/default/xui/es/notifications.xml8
-rw-r--r--indra/newview/skins/default/xui/es/panel_region_general.xml3
-rw-r--r--indra/newview/skins/default/xui/es/strings.xml4
10 files changed, 117 insertions, 61 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 43c8c679c6..8e959993fe 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3016,41 +3016,59 @@ void LLAppViewer::migrateCacheDirectory()
#endif // LL_WINDOWS || LL_DARWIN
}
+//static
+S32 LLAppViewer::getCacheVersion()
+{
+ static const S32 cache_version = 7;
+
+ return cache_version ;
+}
+
bool LLAppViewer::initCache()
{
mPurgeCache = false;
- // Purge cache if user requested it
- if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
- gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
+ BOOL disable_texture_cache = FALSE ;
+ BOOL read_only = mSecondInstance ? TRUE : FALSE;
+ LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
+
+ if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getCacheVersion())
{
- gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
- mPurgeCache = 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());
+ }
}
- // Purge cache if it belongs to an old version
- else
+
+ if(!read_only)
{
- static const S32 cache_version = 6;
- if (gSavedSettings.getS32("LocalCacheVersion") != cache_version)
+ // Purge cache if user requested it
+ if (gSavedSettings.getBOOL("PurgeCacheOnStartup") ||
+ gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
{
+ gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
mPurgeCache = true;
- gSavedSettings.setS32("LocalCacheVersion", cache_version);
}
- }
- // We have moved the location of the cache directory over time.
- migrateCacheDirectory();
-
- // Setup and verify the cache location
- std::string cache_location = gSavedSettings.getString("CacheLocation");
- std::string new_cache_location = gSavedSettings.getString("NewCacheLocation");
- if (new_cache_location != cache_location)
- {
- gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"));
- purgeCache(); // purge old cache
- gSavedSettings.setString("CacheLocation", new_cache_location);
- gSavedSettings.setString("CacheLocationTopFolder", gDirUtilp->getBaseFileName(new_cache_location));
- }
+ // We have moved the location of the cache directory over time.
+ migrateCacheDirectory();
+ // Setup and verify the cache location
+ std::string cache_location = gSavedSettings.getString("CacheLocation");
+ std::string new_cache_location = gSavedSettings.getString("NewCacheLocation");
+ if (new_cache_location != cache_location)
+ {
+ gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"));
+ purgeCache(); // purge old cache
+ gSavedSettings.setString("CacheLocation", new_cache_location);
+ gSavedSettings.setString("CacheLocationTopFolder", gDirUtilp->getBaseFileName(new_cache_location));
+ }
+ }
+
if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")))
{
LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL;
@@ -3058,7 +3076,7 @@ bool LLAppViewer::initCache()
gSavedSettings.setString("CacheLocationTopFolder", "");
}
- if (mPurgeCache)
+ if (mPurgeCache && !read_only)
{
LLSplashScreen::update(LLTrans::getString("StartupClearingCache"));
purgeCache();
@@ -3067,14 +3085,13 @@ bool LLAppViewer::initCache()
LLSplashScreen::update(LLTrans::getString("StartupInitializingTextureCache"));
// Init the texture cache
- // Allocate 80% of the cache size for textures
- BOOL read_only = mSecondInstance ? TRUE : FALSE;
+ // Allocate 80% of the cache size for textures
const S32 MB = 1024*1024;
S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB;
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, read_only);
+ S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, disable_texture_cache);
texture_cache_size -= extra;
LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS"));
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index a915b7fa50..60645c46d4 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -102,6 +102,8 @@ public:
static LLImageDecodeThread* getImageDecodeThread() { return sImageDecodeThread; }
static LLTextureFetch* getTextureFetch() { return sTextureFetch; }
+ static S32 getCacheVersion() ;
+
const std::string& getSerialNumber() { return mSerialNumber; }
bool getPurgeCache() const { return mPurgeCache; }
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 651070a2ea..df79725474 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -742,7 +742,7 @@ LLTextureCache::LLTextureCache(bool threaded)
mHeaderMutex(NULL),
mListMutex(NULL),
mHeaderAPRFile(NULL),
- mReadOnly(FALSE),
+ mReadOnly(TRUE), //do not allow to change the texture cache until setReadOnly() is called.
mTexturesSizeTotal(0),
mDoPurge(FALSE)
{
@@ -929,13 +929,16 @@ U32 LLTextureCache::sCacheMaxEntries = MAX_REASONABLE_FILE_SIZE / TEXTURE_CACHE_
S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit
const char* entries_filename = "texture.entries";
const char* cache_filename = "texture.cache";
-const char* textures_dirname = "textures";
+const char* old_textures_dirname = "textures";
+//change the location of the texture cache to prevent from being deleted by old version viewers.
+const char* textures_dirname = "texturecache";
void LLTextureCache::setDirNames(ELLPath location)
{
std::string delem = gDirUtilp->getDirDelimiter();
- mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, entries_filename);
- mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, cache_filename);
+
+ mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, entries_filename);
+ mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, cache_filename);
mTexturesDirName = gDirUtilp->getExpandedFilename(location, textures_dirname);
}
@@ -947,16 +950,38 @@ void LLTextureCache::purgeCache(ELLPath location)
{
setDirNames(location);
llassert_always(mHeaderAPRFile == NULL);
- LLAPRFile::remove(mHeaderEntriesFileName, getLocalAPRFilePool());
- LLAPRFile::remove(mHeaderDataFileName, getLocalAPRFilePool());
+
+ //remove the legacy cache if exists
+ std::string texture_dir = mTexturesDirName ;
+ mTexturesDirName = gDirUtilp->getExpandedFilename(location, old_textures_dirname);
+ if(LLFile::isdir(mTexturesDirName))
+ {
+ std::string file_name = gDirUtilp->getExpandedFilename(location, entries_filename);
+ LLAPRFile::remove(file_name, getLocalAPRFilePool());
+
+ file_name = gDirUtilp->getExpandedFilename(location, cache_filename);
+ LLAPRFile::remove(file_name, getLocalAPRFilePool());
+
+ purgeAllTextures(true);
+ }
+ mTexturesDirName = texture_dir ;
}
+
+ //remove the current texture cache.
purgeAllTextures(true);
}
-S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only)
+//is called in the main thread before initCache(...) is called.
+void LLTextureCache::setReadOnly(BOOL read_only)
{
- mReadOnly = read_only;
-
+ mReadOnly = read_only ;
+}
+
+//called in the main thread.
+S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL disable_texture_cache)
+{
+ llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized.
+
S64 header_size = (max_size * 2) / 10;
S64 max_entries = header_size / TEXTURE_CACHE_ENTRY_SIZE;
sCacheMaxEntries = (S32)(llmin((S64)sCacheMaxEntries, max_entries));
@@ -968,6 +993,15 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only)
sCacheMaxTexturesSize = max_size;
max_size -= sCacheMaxTexturesSize;
+ if(disable_texture_cache) //the texture cache is disabled
+ {
+ llinfos << "The texture cache is disabled!" << llendl ;
+ setReadOnly(TRUE) ;
+ purgeAllTextures(true);
+
+ return max_size ;
+ }
+
LL_INFOS("TextureCache") << "Headers: " << sCacheMaxEntries
<< " Textures size: " << sCacheMaxTexturesSize/(1024*1024) << " MB" << LL_ENDL;
@@ -976,6 +1010,7 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only)
if (!mReadOnly)
{
LLFile::mkdir(mTexturesDirName);
+
const char* subdirs = "0123456789abcdef";
for (S32 i=0; i<16; i++)
{
@@ -986,6 +1021,8 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL read_only)
readHeaderCache();
purgeTextures(true); // calc mTexturesSize and make some room in the texture cache if we need it
+ llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized.
+
return max_size; // unused cache space
}
@@ -1462,9 +1499,9 @@ void LLTextureCache::purgeAllTextures(bool purge_directories)
}
if (purge_directories)
{
- gDirUtilp->deleteFilesInDir(mTexturesDirName,mask);
+ gDirUtilp->deleteFilesInDir(mTexturesDirName, mask);
LLFile::rmdir(mTexturesDirName);
- }
+ }
}
mHeaderIDMap.clear();
mTexturesSizeMap.clear();
diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h
index ca8815ee7e..5dc06ff401 100644
--- a/indra/newview/lltexturecache.h
+++ b/indra/newview/lltexturecache.h
@@ -110,7 +110,8 @@ public:
/*virtual*/ S32 update(U32 max_time_ms);
void purgeCache(ELLPath location);
- S64 initCache(ELLPath location, S64 maxsize, BOOL read_only);
+ void setReadOnly(BOOL read_only) ;
+ S64 initCache(ELLPath location, S64 maxsize, BOOL disable_texture_cache);
handle_t readFromCache(const std::string& local_filename, const LLUUID& id, U32 priority, S32 offset, S32 size,
ReadResponder* responder);
diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
index 1e2440580e..27f8b4bb39 100644
--- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml
@@ -6,7 +6,7 @@
name="Hardware Settings Floater"
help_topic="hardware_settings_floater"
title="HARDWARE SETTINGS"
- width="500">
+ width="615">
<text
type="string"
length="1"
@@ -16,7 +16,7 @@
left="10"
name="Filtering:"
top="20"
- width="128">
+ width="188">
Filtering:
</text>
<check_box
@@ -37,7 +37,7 @@
left="10"
name="Antialiasing:"
top_pad="7"
- width="128">
+ width="188">
Antialiasing:
</text>
<combo_box
@@ -79,13 +79,13 @@
increment="0.01"
initial_value="1"
label="Gamma:"
- label_width="138"
+ label_width="198"
layout="topleft"
left="10"
max_val="2"
name="gamma"
top_pad="7"
- width="202" />
+ width="262" />
<text
type="string"
length="1"
@@ -95,7 +95,7 @@
left_pad="10"
name="(brightness, lower is brighter)"
top_delta="2"
- width="315">
+ width="385">
(0 = default brightness, lower = brighter)
</text>
<text
@@ -107,7 +107,7 @@
left="10"
name="Enable VBO:"
top_pad="10"
- width="128">
+ width="188">
Enable VBO:
</text>
<check_box
@@ -128,14 +128,14 @@
increment="16"
initial_value="32"
label="Texture Memory (MB):"
- label_width="135"
+ label_width="195"
layout="topleft"
left="10"
max_val="4096"
name="GraphicsCardTextureMemory"
tool_tip="Amount of memory to allocate for textures. Defaults to video card memory. Reducing this may improve performance but may also make textures blurry."
top_pad="10"
- width="300" />
+ width="360" />
<spinner
control_name="RenderFogRatio"
decimal_digits="1"
@@ -143,14 +143,14 @@
height="22"
initial_value="4"
label="Fog Distance Ratio:"
- label_width="138"
+ label_width="198"
layout="topleft"
left_delta="0"
max_val="10"
min_val="0.5"
name="fog"
top_pad="7"
- width="202" />
+ width="262" />
<button
follows="right|bottom"
height="22"
diff --git a/indra/newview/skins/default/xui/es/floater_land_holdings.xml b/indra/newview/skins/default/xui/es/floater_land_holdings.xml
index 36a02b7300..ed7055b3a1 100644
--- a/indra/newview/skins/default/xui/es/floater_land_holdings.xml
+++ b/indra/newview/skins/default/xui/es/floater_land_holdings.xml
@@ -17,7 +17,7 @@
<column label="Superficie" name="area"/>
</scroll_list>
<text name="allowed_label">
- Propiedades de terreno permitidas en el plan de pago actual:
+ Propiedad de terreno permitida en el plan de pago:
</text>
<text name="allowed_text">
[AREA] m²
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index 93964a2f4f..bef803b45c 100644
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -19,7 +19,7 @@
<menu_item_call label="Dejar el estatus de Administrador" name="Leave Admin Options"/>
<menu_item_call label="Salir de [APP_NAME]" name="Quit"/>
</menu>
- <menu label="Comunicarse" name="Communicate">
+ <menu label="Comunicarme" name="Communicate">
<menu_item_call label="Mis amigos" name="My Friends"/>
<menu_item_call label="Mis grupos" name="My Groups"/>
<menu_item_check label="Chat" name="Nearby Chat"/>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index df18b88832..9cb3b70260 100644
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -74,7 +74,7 @@ Detalles del error: la notificación de nombre &apos;[_NAME]&apos; no se ha enco
<notification name="LoginFailedNoNetwork">
No se puede conectar con [SECOND_LIFE_GRID].
&apos;[DIAGNOSTIC]&apos;
-Asegúrate de que tu conexión a internet está funcionando adecuadamente.
+Asegúrate de que tu conexión a Internet está funcionando adecuadamente.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="MessageTemplateNotFound">
@@ -903,7 +903,7 @@ Deberás reconfigurar el nombre y las opciones de la nueva parcela.
Generalmente, esto es un fallo pasajero. Por favor, personaliza y guarda el ítem de aquí a unos minutos.
</notification>
<notification name="YouHaveBeenLoggedOut">
- Vaya, se ha cerrado tu sesión en [SECOND_LIFE]
+ Vaya, se ha cerrado tu sesión en [SECOND_LIFE].
[MESSAGE]
<usetemplate name="okcancelbuttons" notext="Salir" yestext="Ver MI y Chat"/>
</notification>
@@ -1093,9 +1093,9 @@ Si es la primera vez que usas [SECOND_LIFE], debes crear una cuenta antes de pod
<usetemplate name="okcancelbuttons" notext="Continuar" yestext="Cuenta nueva..."/>
</notification>
<notification name="LoginPacketNeverReceived">
- Tenemos problemas de conexión. Puede deberse a un problema de tu conexión a internet o de [SECOND_LIFE_GRID].
+ Tenemos problemas de conexión. Puede deberse a un problema de tu conexión a Internet o de [SECOND_LIFE_GRID].
-Puedes revisar tu conexión a internet y volver a intentarlo en unos minutos, pulsar Ayuda para conectarte a [SUPPORT_SITE], o pulsar Teleporte para intentar teleportarte a tu Base.
+Puedes revisar tu conexión a Internet y volver a intentarlo en unos minutos, pulsar Ayuda para conectarte a [SUPPORT_SITE], o pulsar Teleporte para intentar teleportarte a tu Base.
<url name="url">
http://es.secondlife.com/support/
</url>
diff --git a/indra/newview/skins/default/xui/es/panel_region_general.xml b/indra/newview/skins/default/xui/es/panel_region_general.xml
index 54b60b276c..9ee7bef493 100644
--- a/indra/newview/skins/default/xui/es/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_general.xml
@@ -24,8 +24,7 @@
<check_box label="Impedir los &apos;empujones&apos;" name="restrict_pushobject"/>
<check_box label="Permitir la reventa del terreno" name="allow_land_resell_check"/>
<check_box label="Permitir unir/dividir el terreno" name="allow_parcel_changes_check"/>
- <check_box label="Bloquear el mostrar el terreno en
-la búsqueda." name="block_parcel_search_check" tool_tip="Permitir que la gente vea esta región y sus parcelas en los resultados de la búsqueda."/>
+ <check_box label="Bloquear el mostrar el terreno en la búsqueda" name="block_parcel_search_check" tool_tip="Permitir que la gente vea esta región y sus parcelas en los resultados de la búsqueda."/>
<spinner label="Nº máximo de avatares" label_width="120" name="agent_limit_spin" width="180"/>
<spinner label="Plus de objetos" label_width="120" name="object_bonus_spin" width="180"/>
<text label="Calificación" name="access_text">
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 4fe72924b5..0f2af7aaef 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -89,7 +89,7 @@
Descargando la ropa...
</string>
<string name="LoginFailedNoNetwork">
- Error de red: no se ha podido conectar; por favor, revisa tu conexión a internet.
+ Error de red: no se ha podido conectar; por favor, revisa tu conexión a Internet.
</string>
<string name="LoginFailed">
Error en el inicio de sesión.
@@ -101,7 +101,7 @@
http://join.secondlife.com/index.php?lang=es-ES
</string>
<string name="AgentLostConnection">
- Esta región puede estar teniendo problemas. Por favor, comprueba tu conexión a internet.
+ Esta región puede estar teniendo problemas. Por favor, comprueba tu conexión a Internet.
</string>
<string name="SavingSettings">
Guardando tus configuraciones...