diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llerror.h | 2 | ||||
-rw-r--r-- | indra/llmath/llmath.h | 2 | ||||
-rw-r--r-- | indra/llrender/llimagegl.cpp | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 5a4c644859..09812de2b8 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -242,7 +242,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; do { \ static LLError::CallSite _site( \ level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, broadTag, narrowTag, once);\ - if (_site.shouldLog()) \ + if (LL_UNLIKELY(_site.shouldLog())) \ { \ std::ostringstream* _out = LLError::Log::out(); \ (*_out) diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 7a5d51ff76..209b506c30 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -203,7 +203,7 @@ inline S32 llfloor( F32 f ) } return result; #else - return (S32)floor(f); + return (S32)floorf(f); #endif } 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)) { |