Initilization guards added to llviewertexturelist.

This commit is contained in:
Shyotl
2011-06-16 22:45:10 -05:00
parent 6d9b7b14ad
commit a6e29b5c5e
3 changed files with 41 additions and 4 deletions

View File

@@ -100,6 +100,13 @@ void LLStandardBumpmap::restoreGL()
// static
void LLStandardBumpmap::addstandard()
{
if(!gTextureList.isInitialized())
{
//Note: loading pre-configuration sometimes triggers this call.
//But it is safe to return here because bump images will be reloaded during initialization later.
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();
@@ -891,6 +898,11 @@ void LLBumpImageList::destroyGL()
void LLBumpImageList::restoreGL()
{
if(!gTextureList.isInitialized())
{
//safe to return here because bump images will be reloaded during initialization later.
return ;
}
LLStandardBumpmap::restoreGL();
// Images will be recreated as they are needed.
}