Merge branch 'V2MultiWear' of git://github.com/siana/SingularityViewer into V2MultiWear
This commit is contained in:
@@ -352,7 +352,10 @@ void LLImageGL::destroyGL(BOOL save_state)
|
|||||||
glimage->mSaveData = NULL ;
|
glimage->mSaveData = NULL ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
glimage->mSaveDiscardLevel = glimage->mCurrentDiscardLevel;
|
||||||
stored_count++;
|
stored_count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glimage->destroyGLTexture();
|
glimage->destroyGLTexture();
|
||||||
@@ -379,13 +382,14 @@ void LLImageGL::restoreGL()
|
|||||||
}
|
}
|
||||||
if (glimage->mSaveData.notNull())
|
if (glimage->mSaveData.notNull())
|
||||||
{
|
{
|
||||||
if (glimage->getComponents() && glimage->mSaveData->getComponents())
|
if (glimage->getComponents() && glimage->mSaveData->getComponents() && glimage->mSaveDiscardLevel >= 0)
|
||||||
{
|
{
|
||||||
glimage->createGLTexture(glimage->mCurrentDiscardLevel, glimage->mSaveData, 0, TRUE, glimage->getCategory());
|
glimage->createGLTexture(glimage->mSaveDiscardLevel, glimage->mSaveData, 0, TRUE, glimage->getCategory());
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
recovered_count++;
|
recovered_count++;
|
||||||
}
|
}
|
||||||
glimage->mSaveData = NULL; // deletes data
|
glimage->mSaveData = NULL; // deletes data
|
||||||
|
glimage->mSaveDiscardLevel = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
llinfos << "Restored " << recovered_count << " images" << llendl;
|
llinfos << "Restored " << recovered_count << " images" << llendl;
|
||||||
@@ -430,7 +434,7 @@ BOOL LLImageGL::create(LLPointer<LLImageGL>& dest, const LLImageRaw* imageraw, B
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
LLImageGL::LLImageGL(BOOL usemipmaps)
|
LLImageGL::LLImageGL(BOOL usemipmaps)
|
||||||
: mSaveData(0)
|
: mSaveData(0), mSaveDiscardLevel(-1)
|
||||||
{
|
{
|
||||||
init(usemipmaps);
|
init(usemipmaps);
|
||||||
setSize(0, 0, 0);
|
setSize(0, 0, 0);
|
||||||
@@ -439,7 +443,7 @@ LLImageGL::LLImageGL(BOOL usemipmaps)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps)
|
LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps)
|
||||||
: mSaveData(0)
|
: mSaveData(0), mSaveDiscardLevel(-1)
|
||||||
{
|
{
|
||||||
llassert( components <= 4 );
|
llassert( components <= 4 );
|
||||||
init(usemipmaps);
|
init(usemipmaps);
|
||||||
@@ -449,7 +453,7 @@ LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLImageGL::LLImageGL(const LLImageRaw* imageraw, BOOL usemipmaps)
|
LLImageGL::LLImageGL(const LLImageRaw* imageraw, BOOL usemipmaps)
|
||||||
: mSaveData(0)
|
: mSaveData(0), mSaveDiscardLevel(-1)
|
||||||
{
|
{
|
||||||
init(usemipmaps);
|
init(usemipmaps);
|
||||||
setSize(0, 0, 0);
|
setSize(0, 0, 0);
|
||||||
@@ -1415,6 +1419,8 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
|
|||||||
if (discard_level < 0)
|
if (discard_level < 0)
|
||||||
{
|
{
|
||||||
discard_level = mCurrentDiscardLevel;
|
discard_level = mCurrentDiscardLevel;
|
||||||
|
if(discard_level < 0)
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mTexName == 0 || discard_level < mCurrentDiscardLevel || discard_level > mMaxDiscardLevel )
|
if (mTexName == 0 || discard_level < mCurrentDiscardLevel || discard_level > mMaxDiscardLevel )
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
LLPointer<LLImageRaw> mSaveData; // used for destroyGL/restoreGL
|
LLPointer<LLImageRaw> mSaveData; // used for destroyGL/restoreGL
|
||||||
|
S32 mSaveDiscardLevel;
|
||||||
U8* mPickMask; //downsampled bitmap approximation of alpha channel. NULL if no alpha channel
|
U8* mPickMask; //downsampled bitmap approximation of alpha channel. NULL if no alpha channel
|
||||||
U16 mPickMaskWidth;
|
U16 mPickMaskWidth;
|
||||||
U16 mPickMaskHeight;
|
U16 mPickMaskHeight;
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
|
|||||||
static const unsigned int indices_per_quad = 6;
|
static const unsigned int indices_per_quad = 6;
|
||||||
|
|
||||||
static const LLCachedControl<bool> render_transparent_water("RenderTransparentWater",false);
|
static const LLCachedControl<bool> render_transparent_water("RenderTransparentWater",false);
|
||||||
const S32 size = (render_transparent_water && !LLGLSLShader::sNoFixedFunction) ? 16 : 1;
|
const S32 size = (render_transparent_water && LLGLSLShader::sNoFixedFunction) ? 16 : 1;
|
||||||
const S32 num_quads = size * size;
|
const S32 num_quads = size * size;
|
||||||
face->setSize(vertices_per_quad * num_quads,
|
face->setSize(vertices_per_quad * num_quads,
|
||||||
indices_per_quad * num_quads);
|
indices_per_quad * num_quads);
|
||||||
|
|||||||
Reference in New Issue
Block a user