llrender and lldir merge. Removed duplicate assets from skins. cleaned up skin textures.xml files to only include changes from default.
This commit is contained in:
@@ -2204,26 +2204,10 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
|
||||
U32 LLImageGL::createPickMask(S32 pWidth, S32 pHeight)
|
||||
{
|
||||
if(!mNeedsAlphaAndPickMask)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
delete [] mPickMask;
|
||||
mPickMask = NULL;
|
||||
mPickMaskWidth = mPickMaskHeight = 0;
|
||||
|
||||
if (mFormatType != GL_UNSIGNED_BYTE ||
|
||||
mFormatPrimary != GL_RGBA)
|
||||
{
|
||||
//cannot generate a pick mask for this texture
|
||||
return;
|
||||
}
|
||||
|
||||
U32 pick_width = width/2 + 1;
|
||||
U32 pick_height = height/2 + 1;
|
||||
U32 pick_width = pWidth/2 + 1;
|
||||
U32 pick_height = pHeight/2 + 1;
|
||||
|
||||
U32 size = pick_width * pick_height;
|
||||
size = (size + 7) / 8; // pixelcount-to-bits
|
||||
@@ -2233,6 +2217,44 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
|
||||
|
||||
memset(mPickMask, 0, sizeof(U8) * size);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void LLImageGL::freePickMask()
|
||||
{
|
||||
// pickmask validity depends on old image size, delete it
|
||||
if (mPickMask != NULL)
|
||||
{
|
||||
delete [] mPickMask;
|
||||
}
|
||||
mPickMask = NULL;
|
||||
mPickMaskWidth = mPickMaskHeight = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
|
||||
{
|
||||
if(!mNeedsAlphaAndPickMask)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
freePickMask();
|
||||
|
||||
if (mFormatType != GL_UNSIGNED_BYTE ||
|
||||
mFormatPrimary != GL_RGBA)
|
||||
{
|
||||
//cannot generate a pick mask for this texture
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SHOW_ASSERT
|
||||
const U32 pickSize = createPickMask(width, height);
|
||||
#else // SHOW_ASSERT
|
||||
createPickMask(width, height);
|
||||
#endif // SHOW_ASSERT
|
||||
|
||||
U32 pick_bit = 0;
|
||||
|
||||
for (S32 y = 0; y < height; y += 2)
|
||||
@@ -2245,7 +2267,7 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
|
||||
{
|
||||
U32 pick_idx = pick_bit/8;
|
||||
U32 pick_offset = pick_bit%8;
|
||||
llassert(pick_idx < size);
|
||||
llassert(pick_idx < pickSize);
|
||||
|
||||
mPickMask[pick_idx] |= 1 << pick_offset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user