summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-02-26 01:52:28 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-02-26 01:52:28 -0800
commit2d7697dfade4ecbb8fbe9b26a5332fc9e93f5669 (patch)
tree5e956b1e9bfc1efd65bcd365abac613b4d4baf04 /indra/llrender/llimagegl.cpp
parent5c73a908353cdd7210e3148f7162d30afab7873a (diff)
parent6ea944b38f1e619df2c52283f6b33bbcc1cbbc40 (diff)
automated merge
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 8bcc4723ae..36ac3ff119 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1693,11 +1693,11 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
return;
}
- U32 pick_width = width/2;
- U32 pick_height = height/2;
+ U32 pick_width = width/2 + 1;
+ U32 pick_height = height/2 + 1;
- U32 size = llmax(pick_width, (U32) 1) * llmax(pick_height, (U32) 1);
- size = size/8 + 1;
+ U32 size = pick_width * pick_height;
+ size = (size + 7) / 8; // pixelcount-to-bits
mPickMask = new U8[size];
mPickMaskWidth = pick_width;
mPickMaskHeight = pick_height;
@@ -1745,8 +1745,8 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
llassert(mPickMaskWidth > 0 && mPickMaskHeight > 0);
- S32 x = (S32)(u * mPickMaskWidth);
- S32 y = (S32)(v * mPickMaskHeight);
+ S32 x = llfloor(u * mPickMaskWidth);
+ S32 y = llfloor(v * mPickMaskHeight);
if (LL_UNLIKELY(x >= mPickMaskWidth))
{