diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index efffa89b0..a940163e7 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -45,18 +45,17 @@ if (WINDOWS) if (MSVC10) set(MSVC_DIR 10.0) set(MSVC_SUFFIX 100) + elseif (MSVC12) + set(MSVC_DIR 12.0) + set(MSVC_SUFFIX 120) endif (MSVC10) - if (MSVC11) - set(MSVC_DIR 11.0) - set(MSVC_SUFFIX 110) - endif (MSVC11) # Remove default /Zm1000 flag that cmake inserts string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - if (MSVC11) + if (MSVC12) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm140") - endif (MSVC11) + endif (MSVC12) # Don't build DLLs. @@ -87,7 +86,7 @@ if (WINDOWS) /W3 /c /Zc:forScope - /Zc:wchar_t- + /Zc:wchar_t- /nologo /Oy- ) @@ -99,9 +98,15 @@ if (WINDOWS) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244") endif(WORD_SIZE EQUAL 32) - # configure win32 API for windows XP+ compatibility - set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") - add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") + if (MSVC12) + # configure win32 API for windows vista+ compatibility + set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") + add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") + else (MSVC12) + # configure win32 API for windows XP+ compatibility + set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)") + add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}") + endif (MSVC12) # Are we using the crummy Visual Studio KDU build workaround? if (NOT DISABLE_FATAL_WARNINGS) diff --git a/indra/cmake/Colladadom.cmake b/indra/cmake/Colladadom.cmake index e503d99e7..cc4fa50ea 100644 --- a/indra/cmake/Colladadom.cmake +++ b/indra/cmake/Colladadom.cmake @@ -1,6 +1,7 @@ # -*- cmake -*- include(Prebuilt) +include(Boost) set(COLLADADOM_FIND_QUIETLY OFF) set(COLLADADOM_FIND_REQUIRED ON) @@ -24,11 +25,26 @@ else (STANDALONE) ) if (WINDOWS) - add_definitions(-DDOM_DYNAMIC) - set(COLLADADOM_LIBRARIES - debug libcollada14dom22-d - optimized libcollada14dom22 + if(MSVC12) + use_prebuilt_binary(pcre) + use_prebuilt_binary(libxml) + set(COLLADADOM_LIBRARIES + debug libcollada14dom23-sd + optimized libcollada14dom23-s + libxml2_a + debug pcrecppd + optimized pcrecpp + debug pcred + optimized pcre + ${BOOST_SYSTEM_LIBRARIES} ) + else(MSVC12) + add_definitions(-DDOM_DYNAMIC) + set(COLLADADOM_LIBRARIES + debug libcollada14dom22-d + optimized libcollada14dom22 + ) + endif(MSVC12) else (WINDOWS) set(COLLADADOM_LIBRARIES collada14dom diff --git a/indra/cmake/CopyWinLibs.cmake b/indra/cmake/CopyWinLibs.cmake index fb5093f1b..2e6c1fe05 100644 --- a/indra/cmake/CopyWinLibs.cmake +++ b/indra/cmake/CopyWinLibs.cmake @@ -42,9 +42,13 @@ set(debug_files libapriconv-1.dll libeay32.dll ssleay32.dll - libcollada14dom22-d.dll glod.dll ) + if(MSVC10) + set(release_files ${release_files} + libcollada14dom22-d.dll + ) + endif(MSVC10) copy_if_different( ${debug_src_dir} @@ -223,12 +227,12 @@ set(release_files libapriconv-1.dll libeay32.dll ssleay32.dll - libcollada14dom22.dll glod.dll ) if(WORD_SIZE EQUAL 32) set(release_files ${release_files} + libcollada14dom22.dll libtcmalloc_minimal.dll ) endif(WORD_SIZE EQUAL 32) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 8a8f84526..895e15f0a 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -9,7 +9,11 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(expat) if (WINDOWS) - set(EXPAT_LIBRARIES libexpatMT) + if (MSVC12) + set(EXPAT_LIBRARIES expat) + else (MSVC12) + set(EXPAT_LIBRARIES libexpatMT) + endif (MSVC12) else (WINDOWS) set(EXPAT_LIBRARIES expat) endif (WINDOWS) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index e9d4d8093..7ede1c749 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -11,7 +11,11 @@ else (STANDALONE) set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) else (LINUX) - set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + if(MSVC12) + set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/freetype2) + else(MSVC12) + set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + endif (MSVC12) endif (LINUX) set(FREETYPE_LIBRARIES freetype) diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake index 499089843..f088087cf 100644 --- a/indra/cmake/JsonCpp.cmake +++ b/indra/cmake/JsonCpp.cmake @@ -10,9 +10,15 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(jsoncpp) if (WINDOWS) - set(JSONCPP_LIBRARIES - debug json_vc${MSVC_SUFFIX}d - optimized json_vc${MSVC_SUFFIX}) + if(MSVC12) + set(JSONCPP_LIBRARIES + debug json_vc${MSVC_SUFFIX}debug_libmt.lib + optimized json_vc${MSVC_SUFFIX}_libmt) + else(MSVC12) + set(JSONCPP_LIBRARIES + debug json_vc${MSVC_SUFFIX}d + optimized json_vc${MSVC_SUFFIX}) + endif(MSVC12) elseif (DARWIN) set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt) elseif (LINUX) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 011b87f64..c82e9e06b 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -9,7 +9,11 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(libpng) if (WINDOWS) - set(PNG_LIBRARIES libpng15) + if(MSVC12) + set(PNG_LIBRARIES libpng16) + else(MSVC12) + set(PNG_LIBRARIES libpng15) + endif(MSVC12) elseif(DARWIN) set(PNG_LIBRARIES png15) else(LINUX) diff --git a/indra/develop.py b/indra/develop.py index 0c732cc02..40c4fe459 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -444,14 +444,14 @@ class WindowsSetup(PlatformSetup): 'gen' : r'Visual Studio 10', 'ver' : r'10.0' }, - 'vc110' : { - 'gen' : r'Visual Studio 11', - 'ver' : r'11.0' + 'vc120' : { + 'gen' : r'Visual Studio 12', + 'ver' : r'12.0' } } gens['vs2010'] = gens['vc100'] - gens['vs2012'] = gens['vc110'] + gens['vs2013'] = gens['vc120'] search_path = r'C:\windows' exe_suffixes = ('.exe', '.bat', '.com') diff --git a/indra/libhacd/hacdRaycastMesh.cpp b/indra/libhacd/hacdRaycastMesh.cpp index 2f84bbc11..28e1325a1 100644 --- a/indra/libhacd/hacdRaycastMesh.cpp +++ b/indra/libhacd/hacdRaycastMesh.cpp @@ -17,6 +17,10 @@ #include #include #include "hacdManifoldMesh.h" + +#if _MSC_VER >= 1800 +#include +#endif namespace HACD { bool BBox::Raycast(const Vec3 & origin, const Vec3 & dir, Float & distMin) const diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 711ac21e5..4be835dce 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1111,7 +1111,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 LLVector3 source_to_target = target_pos - keyframe_source_pos; - S32 max_iteration_count = llround(clamp_rescale( + S32 max_iteration_count = llmath::llround(clamp_rescale( mCharacter->getPixelArea(), MAX_PIXEL_AREA_CONSTRAINTS, MIN_PIXEL_AREA_CONSTRAINTS, diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index d12b3ddb6..2764405e5 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -876,12 +876,12 @@ void LLMotionController::updateMotions(bool force_update) // // This old code is nonsense. - //S32 quantum_count = llmax(0, llround((update_time - time_interval) / mTimeStep)) + 1; + //S32 quantum_count = llmax(0, llmath::llround((update_time - time_interval) / mTimeStep)) + 1; // (update_time - time_interval) / mTimeStep is an integer! We need llround to get rid of floating point errors, not llfloor. - // Moreover, just rounding off to the nearest integer with llround(update_time / mTimeStep) makes a lot more sense: + // Moreover, just rounding off to the nearest integer with llmath::llround(update_time / mTimeStep) makes a lot more sense: // it is the best we can do to get as close to what we should draw as possible. // However, mAnimTime may only be incremented; therefore make sure of that with the llmax. - S32 quantum_count = llmax(llround(update_time / mTimeStep), llceil(mAnimTime / mTimeStep)); + S32 quantum_count = llmax(llmath::llround(update_time / mTimeStep), llceil(mAnimTime / mTimeStep)); // if (quantum_count == mTimeStepCount) { diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 8b40edb40..b495f4a4b 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -108,7 +108,7 @@ namespace { mFile.close(); } - bool okay() { return mFile; } + bool okay() { return !!mFile; } virtual bool wantsTime() { return true; } diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index a42af63b6..b451092bf 100644 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -67,7 +67,7 @@ public: LLEventPumpOrPumpName() {} operator LLEventPump& () const { return *mPump; } LLEventPump& getPump() const { return *mPump; } - operator bool() const { return mPump; } + operator bool() const { return !!mPump; } bool operator!() const { return ! mPump; } private: diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 2e0531263..18258ad3a 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1178,13 +1178,13 @@ void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixe a *= norm_factor; // skip conditional S32 t4 = x * out_pixel_step * components; - out[t4 + 0] = U8(llround(r)); + out[t4 + 0] = U8(llmath::llround(r)); if (components >= 2) - out[t4 + 1] = U8(llround(g)); + out[t4 + 1] = U8(llmath::llround(g)); if (components >= 3) - out[t4 + 2] = U8(llround(b)); + out[t4 + 2] = U8(llmath::llround(b)); if( components == 4) - out[t4 + 3] = U8(llround(a)); + out[t4 + 3] = U8(llmath::llround(a)); } } } @@ -1259,10 +1259,10 @@ void LLImageRaw::compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S3 b *= norm_factor; a *= norm_factor; - in_scaled_r = U8(llround(r)); - in_scaled_g = U8(llround(g)); - in_scaled_b = U8(llround(b)); - in_scaled_a = U8(llround(a)); + in_scaled_r = U8(llmath::llround(r)); + in_scaled_g = U8(llmath::llround(g)); + in_scaled_b = U8(llmath::llround(b)); + in_scaled_a = U8(llmath::llround(a)); } if( in_scaled_a ) diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 5f3ad0d5a..d5eff1a8e 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -30,8 +30,12 @@ #include #else // Workaround for wrongly packaged prebuilt. +#if _MSC_VER >= 1800 +#include +#else #include "libpng15/png.h" #endif +#endif #include "llimage.h" class LLPngWrapper diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index ec5415e50..e56568adb 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -174,6 +174,7 @@ inline S32 lltrunc( F32 f ) inline S32 lltrunc( F64 f ) { + return (S32)f; } @@ -204,64 +205,35 @@ inline S32 llceil( F32 f ) } -#ifndef BOGUS_ROUND -// Use this round. Does an arithmetic round (0.5 always rounds up) -inline S32 llround(const F32 val) +namespace llmath { - return llfloor(val + 0.5f); -} - -#else // BOGUS_ROUND -// Old llround implementation - does banker's round (toward nearest even in the case of a 0.5. -// Not using this because we don't have a consistent implementation on both platforms, use -// llfloor(val + 0.5f), which is consistent on all platforms. -inline S32 llround(const F32 val) -{ - #if LL_WINDOWS - // Note: assumes that the floating point control word is set to rounding mode (the default) - S32 ret_val; - _asm fld val - _asm fistp ret_val; - return ret_val; - #elif LL_LINUX - // Note: assumes that the floating point control word is set - // to rounding mode (the default) - S32 ret_val; - __asm__ __volatile__( "flds %1 \n\t" - "fistpl %0 \n\t" - : "=m" (ret_val) - : "m" (val) ); - return ret_val; - #else - return llfloor(val + 0.5f); - #endif -} - -// A fast arithmentic round on intel, from Laurent de Soras http://ldesoras.free.fr -inline int round_int(double x) -{ - const float round_to_nearest = 0.5f; - int i; - __asm + // Use this round. Does an arithmetic round (0.5 always rounds up) + inline S32 llround(const F32 val) { - fld x - fadd st, st (0) - fadd round_to_nearest - fistp i - sar i, 1 +#if __cplusplus >= 201103L || _MSC_VER >= 1800 + return std::round(val); +#else + return llfloor(val + 0.5f); +#endif } - return (i); -} -#endif // BOGUS_ROUND -inline F32 llround( F32 val, F32 nearest ) -{ - return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest; -} + inline F32 llround(F32 val, F32 nearest) + { +#if __cplusplus >= 201103L || _MSC_VER >= 1800 + return F32(std::round(val * (1.0f / nearest))) * nearest; +#else + return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest; +#endif + } -inline F64 llround( F64 val, F64 nearest ) -{ - return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest; + inline F64 llround(F64 val, F64 nearest) + { +#if __cplusplus >= 201103L || _MSC_VER >= 1800 + return F64(std::round(val * (1.0 / nearest))) * nearest; +#else + return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest; +#endif + } } // these provide minimum peak error @@ -309,7 +281,7 @@ const S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point represe #define LL_MAN_INDEX 1 #endif -/* Deprecated: use llround(), lltrunc(), or llfloor() instead +/* Deprecated: use llmath::llround(), lltrunc(), or llfloor() instead // ================================================================================================ // Real2Int // ================================================================================================ @@ -351,7 +323,7 @@ static union #define LL_EXP_A (1048576 * OO_LN2) // use 1512775 for integer #define LL_EXP_C (60801) // this value of C good for -4 < y < 4 -#define LL_FAST_EXP(y) (LLECO.n.i = llround(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d) +#define LL_FAST_EXP(y) (LLECO.n.i = llmath::llround(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d) @@ -370,8 +342,8 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs) bar *= 10.f; } - //F32 new_foo = (F32)llround(foo * bar); - // the llround() implementation sucks. Don't us it. + //F32 new_foo = (F32)llmath::llround(foo * bar); + // the llmath::llround() implementation sucks. Don't us it. F32 sign = (foo > 0.f) ? 1.f : -1.f; F32 new_foo = F32( S64(foo * bar + sign * 0.5f)); diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h index dd0cf2941..6df9c1fb4 100644 --- a/indra/llmath/llquantize.h +++ b/indra/llmath/llquantize.h @@ -52,7 +52,7 @@ inline U16 F32_to_U16_ROUND(F32 val, F32 lower, F32 upper) val /= (upper - lower); // round the value. Sreturn the U16 - return (U16)(llround(val*U16MAX)); + return (U16)(llmath::llround(val*U16MAX)); } @@ -92,7 +92,7 @@ inline U8 F32_to_U8_ROUND(F32 val, F32 lower, F32 upper) val /= (upper - lower); // return the rounded U8 - return (U8)(llround(val*U8MAX)); + return (U8)(llmath::llround(val*U8MAX)); } diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 3b5b2f148..25697eef6 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -560,7 +560,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 // Scale to have size "match" scale. Compensates to get object to generally fill bounding box. - S32 total_sides = llround(sides / ang_scale); // Total number of sides all around + S32 total_sides = llmath::llround(sides / ang_scale); // Total number of sides all around if (total_sides < 8) { diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 9131befd8..6b771c3ad 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -125,10 +125,10 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f); LLColor4::operator const LLColor4U() const { return LLColor4U( - (U8)llclampb(llround(mV[VRED]*255.f)), - (U8)llclampb(llround(mV[VGREEN]*255.f)), - (U8)llclampb(llround(mV[VBLUE]*255.f)), - (U8)llclampb(llround(mV[VALPHA]*255.f))); + (U8)llclampb(llmath::llround(mV[VRED]*255.f)), + (U8)llclampb(llmath::llround(mV[VGREEN]*255.f)), + (U8)llclampb(llmath::llround(mV[VBLUE]*255.f)), + (U8)llclampb(llmath::llround(mV[VALPHA]*255.f))); } LLColor4::LLColor4(const LLColor3 &vec, F32 a) diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index fa1295441..5040f0710 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -353,10 +353,10 @@ inline LLColor4U LLColor4U::multAll(const F32 k) { // Round to nearest return LLColor4U( - (U8)llround(mV[VX] * k), - (U8)llround(mV[VY] * k), - (U8)llround(mV[VZ] * k), - (U8)llround(mV[VW] * k)); + (U8)llmath::llround(mV[VX] * k), + (U8)llmath::llround(mV[VY] * k), + (U8)llmath::llround(mV[VZ] * k), + (U8)llmath::llround(mV[VW] * k)); } /* inline LLColor4U operator*(const LLColor4U &a, U8 k) @@ -471,7 +471,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) color_scale_factor /= max_color; } const S32 MAX_COLOR = 255; - S32 r = llround(color.mV[0] * color_scale_factor); + S32 r = llmath::llround(color.mV[0] * color_scale_factor); if (r > MAX_COLOR) { r = MAX_COLOR; @@ -482,7 +482,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) } mV[0] = r; - S32 g = llround(color.mV[1] * color_scale_factor); + S32 g = llmath::llround(color.mV[1] * color_scale_factor); if (g > MAX_COLOR) { g = MAX_COLOR; @@ -493,7 +493,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) } mV[1] = g; - S32 b = llround(color.mV[2] * color_scale_factor); + S32 b = llmath::llround(color.mV[2] * color_scale_factor); if (b > MAX_COLOR) { b = MAX_COLOR; @@ -505,7 +505,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color) mV[2] = b; // Alpha shouldn't be scaled, just clamped... - S32 a = llround(color.mV[3] * MAX_COLOR); + S32 a = llmath::llround(color.mV[3] * MAX_COLOR); if (a > MAX_COLOR) { a = MAX_COLOR; @@ -527,7 +527,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) } const S32 MAX_COLOR = 255; - S32 r = llround(color.mV[0] * color_scale_factor); + S32 r = llmath::llround(color.mV[0] * color_scale_factor); if (r > MAX_COLOR) { r = MAX_COLOR; @@ -539,7 +539,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) } mV[0] = r; - S32 g = llround(color.mV[1] * color_scale_factor); + S32 g = llmath::llround(color.mV[1] * color_scale_factor); if (g > MAX_COLOR) { g = MAX_COLOR; @@ -551,7 +551,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color) } mV[1] = g; - S32 b = llround(color.mV[2] * color_scale_factor); + S32 b = llmath::llround(color.mV[2] * color_scale_factor); if (b > MAX_COLOR) { b = MAX_COLOR; diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index be3d90e7d..1b8e7fd84 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -466,7 +466,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { // Return true when prepRequest was already called and the object has not been // invalidated as a result of calling aborted(). - bool isValid(void) const { return mResponder; } + bool isValid(void) const { return !!mResponder; } // Return the capability type of this request. AICapabilityType capability_type(void) const { llassert(mCapabilityType != number_of_capability_types); return mCapabilityType; } diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h index c77794e4b..d0c29c54c 100644 --- a/indra/llmessage/llregionhandle.h +++ b/indra/llmessage/llregionhandle.h @@ -73,7 +73,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } else { - x_int = (U32)llround(x_pos); + x_int = (U32)llmath::llround(x_pos); } if (y_pos < 0.f) { @@ -82,7 +82,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } else { - y_int = (U32)llround(y_pos); + y_int = (U32)llmath::llround(y_pos); } *region_handle = to_region_handle(x_int, y_int); return TRUE; diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index 64ebd51fe..b28b9a944 100644 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -391,7 +391,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } mBitsSentThisPeriod[i] = 0; - total += llround(mBitsSentHistory[i]); + total += llmath::llround(mBitsSentHistory[i]); } // Look for busy channels diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index b06751886..03ad0d9d1 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -2765,7 +2765,7 @@ void LLMessageSystem::dumpReceiveCounts() if (mt->mReceiveCount > 0) { LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes - << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl; + << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llmath::llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl; } } } diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index cf4c645cf..bfe8301a7 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -119,18 +119,18 @@ LLSD LLMaterial::asLLSD() const LLSD material_data; material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = llround(mNormalOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = llround(mNormalOffsetY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = llround(mNormalRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = llround(mNormalRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = llround(mNormalRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = llmath::llround(mNormalOffsetX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = llmath::llround(mNormalOffsetY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = llmath::llround(mNormalRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = llmath::llround(mNormalRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = llmath::llround(mNormalRotation * MATERIALS_MULTIPLIER); material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = llround(mSpecularOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = llround(mSpecularOffsetY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = llround(mSpecularRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = llround(mSpecularRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = llround(mSpecularRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = llmath::llround(mSpecularOffsetX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = llmath::llround(mSpecularOffsetY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = llmath::llround(mSpecularRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = llmath::llround(mSpecularRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = llmath::llround(mSpecularRotation * MATERIALS_MULTIPLIER); material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index bdf15cb94..e9b7b2f42 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1142,12 +1142,12 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const const LLTextureEntry* te = getTE(face_index); scale_s[face_index] = (F32) te->mScaleS; scale_t[face_index] = (F32) te->mScaleT; - offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; - offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; - image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); + offset_s[face_index] = (S16) llmath::llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; + offset_t[face_index] = (S16) llmath::llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; + image_rot[face_index] = (S16) llmath::llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); bump[face_index] = te->getBumpShinyFullbright(); media_flags[face_index] = te->getMediaTexGen(); - glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); + glow[face_index] = (U8) llmath::llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); // Directly sending material_ids is not safe! memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */ @@ -1227,12 +1227,12 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const const LLTextureEntry* te = getTE(face_index); scale_s[face_index] = (F32) te->mScaleS; scale_t[face_index] = (F32) te->mScaleT; - offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; - offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; - image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); + offset_s[face_index] = (S16) llmath::llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ; + offset_t[face_index] = (S16) llmath::llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ; + image_rot[face_index] = (S16) llmath::llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR)); bump[face_index] = te->getBumpShinyFullbright(); media_flags[face_index] = te->getMediaTexGen(); - glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); + glow[face_index] = (U8) llmath::llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF)); // Directly sending material_ids is not safe! memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */ diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp index 273ed1b7e..53f035fc3 100644 --- a/indra/llprimitive/llvolumemessage.cpp +++ b/indra/llprimitive/llvolumemessage.cpp @@ -58,13 +58,13 @@ bool LLVolumeMessage::packProfileParams( tempU8 = params->getCurveType(); mesgsys->addU8Fast(_PREHASH_ProfileCurve, tempU8); - tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA); + tempU16 = (U16) llmath::llround( params->getBegin() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_ProfileBegin, tempU16); - tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + tempU16 = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_ProfileEnd, tempU16); - tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA); + tempU16 = (U16) llmath::llround(params->getHollow() / HOLLOW_QUANTA); mesgsys->addU16Fast(_PREHASH_ProfileHollow, tempU16); return true; @@ -86,13 +86,13 @@ bool LLVolumeMessage::packProfileParams( tempU8 = params->getCurveType(); dp.packU8(tempU8, "Curve"); - tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA); + tempU16 = (U16) llmath::llround( params->getBegin() / CUT_QUANTA); dp.packU16(tempU16, "Begin"); - tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + tempU16 = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA); dp.packU16(tempU16, "End"); - tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA); + tempU16 = (U16) llmath::llround(params->getHollow() / HOLLOW_QUANTA); dp.packU16(tempU16, "Hollow"); return true; } @@ -223,46 +223,46 @@ bool LLVolumeMessage::packPathParams( U8 curve = params->getCurveType(); mesgsys->addU8Fast(_PREHASH_PathCurve, curve); - U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA); + U16 begin = (U16) llmath::llround(params->getBegin() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_PathBegin, begin); - U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + U16 end = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA); mesgsys->addU16Fast(_PREHASH_PathEnd, end); // Avoid truncation problem with direct F32->U8 cast. // (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50. - U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA); + U8 pack_scale_x = 200 - (U8) llmath::llround(params->getScaleX() / SCALE_QUANTA); mesgsys->addU8Fast(_PREHASH_PathScaleX, pack_scale_x ); - U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA); + U8 pack_scale_y = 200 - (U8) llmath::llround(params->getScaleY() / SCALE_QUANTA); mesgsys->addU8Fast(_PREHASH_PathScaleY, pack_scale_y ); - U8 pack_shear_x = (U8) llround(params->getShearX() / SHEAR_QUANTA); + U8 pack_shear_x = (U8) llmath::llround(params->getShearX() / SHEAR_QUANTA); mesgsys->addU8Fast(_PREHASH_PathShearX, pack_shear_x ); - U8 pack_shear_y = (U8) llround(params->getShearY() / SHEAR_QUANTA); + U8 pack_shear_y = (U8) llmath::llround(params->getShearY() / SHEAR_QUANTA); mesgsys->addU8Fast(_PREHASH_PathShearY, pack_shear_y ); - S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA); + S8 twist = (S8) llmath::llround(params->getTwist() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTwist, twist); - S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA); + S8 twist_begin = (S8) llmath::llround(params->getTwistBegin() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTwistBegin, twist_begin); - S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA); + S8 radius_offset = (S8) llmath::llround(params->getRadiusOffset() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathRadiusOffset, radius_offset); - S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA); + S8 taper_x = (S8) llmath::llround(params->getTaperX() / TAPER_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTaperX, taper_x); - S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA); + S8 taper_y = (S8) llmath::llround(params->getTaperY() / TAPER_QUANTA); mesgsys->addS8Fast(_PREHASH_PathTaperY, taper_y); - U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA); + U8 revolutions = (U8) llmath::llround( (params->getRevolutions() - 1.0f) / REV_QUANTA); mesgsys->addU8Fast(_PREHASH_PathRevolutions, revolutions); - S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA); + S8 skew = (S8) llmath::llround(params->getSkew() / SCALE_QUANTA); mesgsys->addS8Fast(_PREHASH_PathSkew, skew); return true; @@ -280,46 +280,46 @@ bool LLVolumeMessage::packPathParams( U8 curve = params->getCurveType(); dp.packU8(curve, "Curve"); - U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA); + U16 begin = (U16) llmath::llround(params->getBegin() / CUT_QUANTA); dp.packU16(begin, "Begin"); - U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA); + U16 end = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA); dp.packU16(end, "End"); // Avoid truncation problem with direct F32->U8 cast. // (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50. - U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA); + U8 pack_scale_x = 200 - (U8) llmath::llround(params->getScaleX() / SCALE_QUANTA); dp.packU8(pack_scale_x, "ScaleX"); - U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA); + U8 pack_scale_y = 200 - (U8) llmath::llround(params->getScaleY() / SCALE_QUANTA); dp.packU8(pack_scale_y, "ScaleY"); - S8 pack_shear_x = (S8) llround(params->getShearX() / SHEAR_QUANTA); + S8 pack_shear_x = (S8) llmath::llround(params->getShearX() / SHEAR_QUANTA); dp.packU8(*(U8 *)&pack_shear_x, "ShearX"); - S8 pack_shear_y = (S8) llround(params->getShearY() / SHEAR_QUANTA); + S8 pack_shear_y = (S8) llmath::llround(params->getShearY() / SHEAR_QUANTA); dp.packU8(*(U8 *)&pack_shear_y, "ShearY"); - S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA); + S8 twist = (S8) llmath::llround(params->getTwist() / SCALE_QUANTA); dp.packU8(*(U8 *)&twist, "Twist"); - S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA); + S8 twist_begin = (S8) llmath::llround(params->getTwistBegin() / SCALE_QUANTA); dp.packU8(*(U8 *)&twist_begin, "TwistBegin"); - S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA); + S8 radius_offset = (S8) llmath::llround(params->getRadiusOffset() / SCALE_QUANTA); dp.packU8(*(U8 *)&radius_offset, "RadiusOffset"); - S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA); + S8 taper_x = (S8) llmath::llround(params->getTaperX() / TAPER_QUANTA); dp.packU8(*(U8 *)&taper_x, "TaperX"); - S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA); + S8 taper_y = (S8) llmath::llround(params->getTaperY() / TAPER_QUANTA); dp.packU8(*(U8 *)&taper_y, "TaperY"); - U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA); + U8 revolutions = (U8) llmath::llround( (params->getRevolutions() - 1.0f) / REV_QUANTA); dp.packU8(*(U8 *)&revolutions, "Revolutions"); - S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA); + S8 skew = (S8) llmath::llround(params->getSkew() / SCALE_QUANTA); dp.packU8(*(U8 *)&skew, "Skew"); return true; diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 30b0ed429..f2839bb67 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -184,8 +184,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size, mDescender = -mFTFace->descender * pixels_per_unit; mLineHeight = mFTFace->height * pixels_per_unit; - S32 max_char_width = llround(0.5f + (x_max - x_min)); - S32 max_char_height = llround(0.5f + (y_max - y_min)); + S32 max_char_width = llmath::llround(0.5f + (x_max - x_min)); + S32 max_char_height = llmath::llround(0.5f + (y_max - y_min)); mFontBitmapCachep->init(components, max_char_width, max_char_height); diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 31d48f2ab..4c03726b7 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -230,10 +230,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons case LEFT: break; case RIGHT: - cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)); + cur_x -= llmin(scaled_max_pixels, llmath::llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)); break; case HCENTER: - cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2; + cur_x -= llmin(scaled_max_pixels, llmath::llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2; break; default: break; @@ -242,7 +242,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons cur_render_y = cur_y; cur_render_x = cur_x; - F32 start_x = (F32)llround(cur_x); + F32 start_x = (F32)llmath::llround(cur_x); const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache(); @@ -256,12 +256,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (use_ellipses && halign == LEFT) { // check for too long of a string - S32 string_width = llround(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX); + S32 string_width = llmath::llround(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX); if (string_width > scaled_max_pixels) { // use four dots for ellipsis width to generate padding const LLWString dots(utf8str_to_wstring(std::string("...."))); - scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str()))); + scaled_max_pixels = llmax(0, scaled_max_pixels - llmath::llround(getWidthF32(dots.c_str()))); draw_ellipses = TRUE; } } @@ -308,8 +308,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons gGL.getTexUnit(0)->bind(ext_image); // snap origin to whole screen pixel - const F32 ext_x = (F32)llround(cur_render_x + (EXT_X_BEARING * sScaleX)); - const F32 ext_y = (F32)llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mFontFreetype->getAscenderHeight() - mFontFreetype->getLineHeight())); + const F32 ext_x = (F32)llmath::llround(cur_render_x + (EXT_X_BEARING * sScaleX)); + const F32 ext_y = (F32)llmath::llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mFontFreetype->getAscenderHeight() - mFontFreetype->getLineHeight())); LLRectf uv_rect(0.f, 1.f, 1.f, 0.f); LLRectf screen_rect(ext_x, ext_y + ext_height, ext_x + ext_width, ext_y); @@ -398,10 +398,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons (fgi->mXBitmapOffset + fgi->mWidth) * inv_width, (fgi->mYBitmapOffset - PAD_UVY) * inv_height); // snap glyph origin to whole screen pixel - LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing), - (F32)llround(cur_render_y + (F32)fgi->mYBearing), - (F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth, - (F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight); + LLRectf screen_rect((F32)llmath::llround(cur_render_x + (F32)fgi->mXBearing), + (F32)llmath::llround(cur_render_y + (F32)fgi->mYBearing), + (F32)llmath::llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth, + (F32)llmath::llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight); if (glyph_count >= GLYPH_BATCH_SIZE) { @@ -432,8 +432,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // Must do this to cur_x, not just to cur_render_x, otherwise you // will squish sub-pixel kerned characters too close together. // For example, "CCCCC" looks bad. - cur_x = (F32)llround(cur_x); - //cur_y = (F32)llround(cur_y); + cur_x = (F32)llmath::llround(cur_x); + //cur_y = (F32)llmath::llround(cur_y); cur_render_x = cur_x; cur_render_y = cur_y; @@ -523,7 +523,7 @@ F32 LLFontGL::getDescenderHeight() const F32 LLFontGL::getLineHeight() const { - return (F32)llround(mFontFreetype->getLineHeight() / sScaleY); + return (F32)llmath::llround(mFontFreetype->getLineHeight() / sScaleY); } S32 LLFontGL::getWidth(const std::string& utf8text) const @@ -546,7 +546,7 @@ S32 LLFontGL::getWidth(const std::string& utf8text, const S32 begin_offset, cons S32 LLFontGL::getWidth(const llwchar* wchars, const S32 begin_offset, const S32 max_chars, BOOL use_embedded) const { F32 width = getWidthF32(wchars, begin_offset, max_chars, use_embedded); - return llround(width); + return llmath::llround(width); } F32 LLFontGL::getWidthF32(const std::string& utf8text) const @@ -620,7 +620,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, const S32 begin_offset, const S cur_x += mFontFreetype->getXKerning(fgi, next_glyph); } // Round after kerning. - cur_x = (F32)llround(cur_x); + cur_x = (F32)llmath::llround(cur_x); } } @@ -749,7 +749,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch } } // Round after kerning. - cur_x = (F32)llround(cur_x); + cur_x = (F32)llmath::llround(cur_x); drawn_x = cur_x; } @@ -837,7 +837,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ } // Round after kerning. - total_width = (F32)llround(total_width); + total_width = (F32)llmath::llround(total_width); } if (drawable_chars == 0) @@ -929,7 +929,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, // Round after kerning. - cur_x = (F32)llround(cur_x); + cur_x = (F32)llmath::llround(cur_x); } diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index 18be01d24..4a2ad8302 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -637,8 +637,8 @@ void LLPostProcess::drawOrthoQuad(QuadType type) mVBO->getTexCoord1Strider(uv2); float offs[2] = { - llround(((float) rand() / (float) RAND_MAX) * (float)NOISE_SIZE)/float(NOISE_SIZE), - llround(((float) rand() / (float) RAND_MAX) * (float)NOISE_SIZE)/float(NOISE_SIZE) }; + llmath::llround(((float) rand() / (float) RAND_MAX) * (float)NOISE_SIZE)/float(NOISE_SIZE), + llmath::llround(((float) rand() / (float) RAND_MAX) * (float)NOISE_SIZE)/float(NOISE_SIZE) }; float scale[2] = { (float)mScreenWidth * mNoiseTextureScale, (float)mScreenHeight * mNoiseTextureScale }; diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 7ab223f4d..f8b54ee68 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -401,8 +401,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex F32 image_width = image->getWidth(0); F32 image_height = image->getHeight(0); - S32 image_natural_width = llround(image_width * uv_width); - S32 image_natural_height = llround(image_height * uv_height); + S32 image_natural_width = llmath::llround(image_width * uv_width); + S32 image_natural_height = llmath::llround(image_height * uv_height); LLRectf draw_center_rect( uv_center_rect.mLeft * image_width, uv_center_rect.mTop * image_height, @@ -421,10 +421,10 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex F32 shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio); - draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * shrink_scale * ui_scale.mV[VX]); - draw_center_rect.mTop = llround(ui_translation.mV[VY] + lerp((F32)height, (F32)draw_center_rect.mTop, shrink_scale) * ui_scale.mV[VY]); - draw_center_rect.mRight = llround(ui_translation.mV[VX] + lerp((F32)width, (F32)draw_center_rect.mRight, shrink_scale) * ui_scale.mV[VX]); - draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * shrink_scale * ui_scale.mV[VY]); + draw_center_rect.mLeft = llmath::llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * shrink_scale * ui_scale.mV[VX]); + draw_center_rect.mTop = llmath::llround(ui_translation.mV[VY] + lerp((F32)height, (F32)draw_center_rect.mTop, shrink_scale) * ui_scale.mV[VY]); + draw_center_rect.mRight = llmath::llround(ui_translation.mV[VX] + lerp((F32)width, (F32)draw_center_rect.mRight, shrink_scale) * ui_scale.mV[VX]); + draw_center_rect.mBottom = llmath::llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * shrink_scale * ui_scale.mV[VY]); } LLRectf draw_outer_rect(ui_translation.mV[VX], @@ -664,8 +664,8 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre ui_translation.mV[VY] += y; ui_translation.scaleVec(ui_scale); S32 index = 0; - S32 scaled_width = llround(width * ui_scale.mV[VX]); - S32 scaled_height = llround(height * ui_scale.mV[VY]); + S32 scaled_width = llmath::llround(width * ui_scale.mV[VX]); + S32 scaled_height = llmath::llround(height * ui_scale.mV[VY]); uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); pos[index].set(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f); diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index da122425c..7aa750756 100644 --- a/indra/llrender/lluiimage.cpp +++ b/indra/llrender/lluiimage.cpp @@ -115,13 +115,13 @@ void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& S32 LLUIImage::getWidth() const { // return clipped dimensions of actual image area - return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); + return llmath::llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); } S32 LLUIImage::getHeight() const { // return clipped dimensions of actual image area - return llround((F32)mImage->getHeight(0) * mClipRegion.getHeight()); + return llmath::llround((F32)mImage->getHeight(0) * mClipRegion.getHeight()); } S32 LLUIImage::getTextureWidth() const diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 1b9add0a4..ed318c473 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -536,8 +536,8 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height) overlay_height = mImageOverlay->getHeight(); F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f); - overlay_width = llround((F32)overlay_width * scale_factor); - overlay_height = llround((F32)overlay_height * scale_factor); + overlay_width = llmath::llround((F32)overlay_width * scale_factor); + overlay_height = llmath::llround((F32)overlay_height * scale_factor); } @@ -696,7 +696,7 @@ void LLButton::draw() if (hasFocus()) { F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, llround(lerp(1.f, 3.f, lerp_amt))); + drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, llmath::llround(lerp(1.f, 3.f, lerp_amt))); } if (use_glow_effect) @@ -981,7 +981,7 @@ void LLButton::resize(LLUIString label) { S32 overlay_width = mImageOverlay->getWidth(); F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight(); - overlay_width = llround((F32)overlay_width * scale_factor); + overlay_width = llmath::llround((F32)overlay_width * scale_factor); switch(mImageOverlayAlignment) { diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index ada81b639..caf81cd14 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -83,7 +83,7 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect, // Label (add a little space to make sure text actually renders) const S32 FUDGE = 10; S32 text_width = mFont->getWidth( label ) + FUDGE; - S32 text_height = llround(mFont->getLineHeight()); + S32 text_height = llmath::llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( LLCHECKBOXCTRL_HPAD + LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING, @@ -187,7 +187,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) //stretch or shrink bounding rectangle of label when rebuilding UI at new scale const S32 FUDGE = 10; S32 text_width = mFont->getWidth( mLabel->getText() ) + FUDGE; - S32 text_height = llround(mFont->getLineHeight()); + S32 text_height = llmath::llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( LLCHECKBOXCTRL_HPAD + LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING, diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 33f1a1a1c..de5cbbe7a 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -247,7 +247,7 @@ void LLDragHandleTop::reshapeTitleBox() S32 title_width = font->getWidth( getTitleBox()->getText() ) + TITLE_PAD; if (getMaxTitleWidth() > 0) title_width = llmin(title_width, getMaxTitleWidth()); - S32 title_height = llround(font->getLineHeight()); + S32 title_height = llmath::llround(font->getLineHeight()); LLRect title_rect; title_rect.setLeftTopAndSize( LEFT_PAD, diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c8be07f43..2fa117424 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1449,7 +1449,7 @@ void LLFloater::draw() } gl_drop_shadow(left, top, right, bottom, shadow_color, - llround(shadow_offset)); + llmath::llround(shadow_offset)); // No transparent windows in simple UI if (isBackgroundOpaque()) @@ -1629,16 +1629,16 @@ void LLFloater::updateButtons() btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH, getRect().getHeight() - CLOSE_BOX_FROM_TOP - (LLFLOATER_CLOSE_BOX_SIZE + 1) * button_count, - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + llmath::llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), + llmath::llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); } else { btn_rect.setLeftTopAndSize( getRect().getWidth() - LLPANEL_BORDER_WIDTH - (LLFLOATER_CLOSE_BOX_SIZE + 1) * button_count, getRect().getHeight() - CLOSE_BOX_FROM_TOP, - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + llmath::llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), + llmath::llround((F32)LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); } mButtons[i]->setRect(btn_rect); @@ -1665,16 +1665,16 @@ void LLFloater::buildButtons() btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH, getRect().getHeight() - CLOSE_BOX_FROM_TOP - (LLFLOATER_CLOSE_BOX_SIZE + 1) * (i + 1), - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + llmath::llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), + llmath::llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); } else { btn_rect.setLeftTopAndSize( getRect().getWidth() - LLPANEL_BORDER_WIDTH - (LLFLOATER_CLOSE_BOX_SIZE + 1) * (i + 1), getRect().getHeight() - CLOSE_BOX_FROM_TOP, - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), - llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); + llmath::llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale), + llmath::llround(LLFLOATER_CLOSE_BOX_SIZE * mButtonScale)); } LLButton* buttonp = new LLButton( diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index 7e5e50dfb..fd09bf55f 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -94,7 +94,7 @@ public: F32 getFocusTime() const { return mFocusFlashTimer.getElapsedTimeF32(); } F32 getFocusFlashAmt() const; - S32 getFocusFlashWidth() const { return llround(lerp(1.f, 3.f, getFocusFlashAmt())); } + S32 getFocusFlashWidth() const { return llmath::llround(lerp(1.f, 3.f, getFocusFlashAmt())); } LLColor4 getFocusColor() const; void triggerFocusFlash(); BOOL getAppHasFocus() const { return mAppHasFocus; } diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 83e532a65..73d428f64 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -122,7 +122,7 @@ F32 LLLayoutPanel::getVisibleAmount() const S32 LLLayoutPanel::getLayoutDim() const { - return llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) + return llmath::llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) ? getRect().getWidth() : getRect().getHeight())); } @@ -149,7 +149,7 @@ void LLLayoutPanel::setTargetDim(S32 value) S32 LLLayoutPanel::getVisibleDim() const { F32 min_dim = getRelevantMinDim(); - return llround(mVisibleAmt + return llmath::llround(mVisibleAmt * (min_dim + (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt)))); } @@ -157,7 +157,7 @@ S32 LLLayoutPanel::getVisibleDim() const void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientation ) { mOrientation = orientation; - S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) + S32 layout_dim = llmath::llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL) ? getRect().getWidth() : getRect().getHeight())); @@ -374,14 +374,14 @@ void LLLayoutStack::updateLayout() { panelp->mTargetDim = panelp->getRelevantMinDim(); } - space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount()); + space_to_distribute -= panelp->getVisibleDim() + llmath::llround((F32)mPanelSpacing * panelp->getVisibleAmount()); total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor(); } llassert(total_visible_fraction < 1.05f); // don't need spacing after last panel - space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; + space_to_distribute += panelp ? llmath::llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; S32 remaining_space = space_to_distribute; F32 fraction_distributed = 0.f; @@ -392,7 +392,7 @@ void LLLayoutStack::updateLayout() if (panelp->mAutoResize) { F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction); - S32 delta = llround((F32)space_to_distribute * fraction_to_distribute); + S32 delta = llmath::llround((F32)space_to_distribute * fraction_to_distribute); fraction_distributed += fraction_to_distribute; panelp->mTargetDim += delta; remaining_space -= delta; @@ -425,17 +425,17 @@ void LLLayoutStack::updateLayout() LLRect panel_rect; if (mOrientation == HORIZONTAL) { - panel_rect.setLeftTopAndSize(llround(cur_pos), + panel_rect.setLeftTopAndSize(llmath::llround(cur_pos), getRect().getHeight(), - llround(panel_dim), + llmath::llround(panel_dim), getRect().getHeight()); } else { panel_rect.setLeftTopAndSize(0, - llround(cur_pos), + llmath::llround(cur_pos), getRect().getWidth(), - llround(panel_dim)); + llmath::llround(panel_dim)); } panelp->setIgnoreReshape(true); panelp->setShape(panel_rect); @@ -447,14 +447,14 @@ void LLLayoutStack::updateLayout() if (mOrientation == HORIZONTAL) { resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; - resize_bar_rect.mRight = panel_rect.mRight + (S32)(llround(panel_spacing)) + mResizeBarOverlap; + resize_bar_rect.mRight = panel_rect.mRight + (S32)(llmath::llround(panel_spacing)) + mResizeBarOverlap; cur_pos += panel_visible_dim + panel_spacing; } else //VERTICAL { resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; - resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llround(panel_spacing)) - mResizeBarOverlap; + resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llmath::llround(panel_spacing)) - mResizeBarOverlap; cur_pos -= panel_visible_dim + panel_spacing; } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 6276c0f50..311003b6b 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -512,7 +512,7 @@ std::vector LLLineEditor::getMisspelledWordsPositions() { //misspelled word here, and you have just right clicked on it! //get the center of this word.. - //S32 center = llround( (wordEnd-wordStart)/2 ) + wordStart; + //S32 center = llmath::llround( (wordEnd-wordStart)/2 ) + wordStart; //turn this cursor position into a pixel pos //center = findPixelNearestPos(center-getCursor()); @@ -769,7 +769,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) // Scroll if mouse cursor outside of bounds if (mScrollTimer.hasExpired()) { - S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); + S32 increment = llmath::llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); mScrollTimer.reset(AUTO_SCROLL_TIME); if( (x < mMinHPixels) && (mScrollHPos > 0 ) ) { @@ -1929,7 +1929,7 @@ void LLLineEditor::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, select_left - mScrollHPos, - mMaxHPixels - llround(rendered_pixels_right), + mMaxHPixels - llmath::llround(rendered_pixels_right), &rendered_pixels_right); } @@ -1938,8 +1938,8 @@ void LLLineEditor::draw() LLColor4 color(1.f - bg_color.mV[0], 1.f - bg_color.mV[1], 1.f - bg_color.mV[2], alpha ); // selected middle S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text); - width = llmin(width, mMaxHPixels - llround(rendered_pixels_right)); - gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color); + width = llmin(width, mMaxHPixels - llmath::llround(rendered_pixels_right)); + gl_rect_2d(llmath::llround(rendered_pixels_right), cursor_top, llmath::llround(rendered_pixels_right)+width, cursor_bottom, color); LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ); rendered_text += mGLFont->render( @@ -1950,7 +1950,7 @@ void LLLineEditor::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, select_right - mScrollHPos - rendered_text, - mMaxHPixels - llround(rendered_pixels_right), + mMaxHPixels - llmath::llround(rendered_pixels_right), &rendered_pixels_right); } @@ -1965,7 +1965,7 @@ void LLLineEditor::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mMaxHPixels - llmath::llround(rendered_pixels_right), &rendered_pixels_right); } } @@ -1979,7 +1979,7 @@ void LLLineEditor::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mMaxHPixels - llmath::llround(rendered_pixels_right), &rendered_pixels_right); } #if 0 // for when we're ready for image art. @@ -2047,7 +2047,7 @@ void LLLineEditor::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mMaxHPixels - llmath::llround(rendered_pixels_right), &rendered_pixels_right, FALSE); } @@ -2072,7 +2072,7 @@ void LLLineEditor::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, - mMaxHPixels - llround(rendered_pixels_right), + mMaxHPixels - llmath::llround(rendered_pixels_right), &rendered_pixels_right, FALSE); } // Draw children (border) @@ -3021,7 +3021,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length) S32 LLLineEditor::getPreeditFontSize() const { - return llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); + return llmath::llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); } void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 039c7a789..b35913d6d 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -342,7 +342,7 @@ void LLMenuItemGL::setJumpKey(KEY key) // virtual U32 LLMenuItemGL::getNominalHeight( void ) const { - return llround(mFont->getLineHeight()) + MENU_ITEM_PADDING; + return llmath::llround(mFont->getLineHeight()) + MENU_ITEM_PADDING; } //virtual @@ -1826,7 +1826,7 @@ void LLMenuItemBranchDownGL::draw( void ) std::string::size_type offset = upper_case_label.find(getJumpKey()); if (offset != std::string::npos) { - S32 x_offset = llround((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f); + S32 x_offset = llmath::llround((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f); S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset); S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1); gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS); @@ -2660,7 +2660,7 @@ void LLMenuGL::arrange( void ) // *FIX: create the item first and then ask for its dimensions? S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::getFontSansSerif()->getWidth( std::string("More") ); // *TODO: Translate - S32 spillover_item_height = llround(LLFontGL::getFontSansSerif()->getLineHeight()) + MENU_ITEM_PADDING; + S32 spillover_item_height = llmath::llround(LLFontGL::getFontSansSerif()->getLineHeight()) + MENU_ITEM_PADDING; // Scrolling support item_list_t::iterator first_visible_item_iter; @@ -3588,8 +3588,8 @@ BOOL LLMenuGL::handleHover( S32 x, S32 y, MASK mask ) LLVector2 mouse_avg_dir((F32)mMouseVelX, (F32)mMouseVelY); mouse_avg_dir.normVec(); F32 interp = 0.5f * (llclamp(mouse_dir * mouse_avg_dir, 0.f, 1.f)); - mMouseVelX = llround(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp)); - mMouseVelY = llround(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp)); + mMouseVelX = llmath::llround(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp)); + mMouseVelY = llmath::llround(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp)); mLastMouseX = x; mLastMouseY = y; diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 8c8f94113..e210d856e 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -292,7 +292,7 @@ void LLModalDialog::draw() void LLModalDialog::centerOnScreen() { LLVector2 window_size = LLUI::getWindowSize(); - centerWithin(LLRect(0, 0, llround(window_size.mV[VX]), llround(window_size.mV[VY]))); + centerWithin(LLRect(0, 0, llmath::llround(window_size.mV[VX]), llmath::llround(window_size.mV[VY]))); } diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp index 0443c480a..36ff5587e 100644 --- a/indra/llui/llprogressbar.cpp +++ b/indra/llui/llprogressbar.cpp @@ -84,7 +84,7 @@ void LLProgressBar::draw() bar_bg_imagep->draw(getLocalRect(), background_color % alpha); LLRect progress_rect = getLocalRect(); - progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f)); + progress_rect.mRight = llmath::llround(getRect().getWidth() * (mPercentDone / 100.f)); bar_fg_imagep->draw(progress_rect, LLColor4::white % alpha); } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index f7a658ad6..ad1b4ead0 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -299,7 +299,7 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) // clip rect against root view inner_rect_local.intersectWith(screen_local_extents); - S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); + S32 auto_scroll_speed = llmath::llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); // autoscroll region should take up no more than one third of visible scroller area S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10); S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10); diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index dba472842..cc5453445 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -254,7 +254,7 @@ BOOL LLScrollListText::getVisible() const //virtual S32 LLScrollListText::getHeight() const { - return llround(mFont->getLineHeight()); + return llmath::llround(mFont->getLineHeight()); } @@ -326,7 +326,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col break; } LLRect highlight_rect(left - 2, - llround(mFont->getLineHeight()) + 1, + llmath::llround(mFont->getLineHeight()) + 1, left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1, 1); mRoundedRectImage->draw(highlight_rect, highlight_color); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 3e6e70703..22bf27f4d 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -602,7 +602,7 @@ bool LLScrollListCtrl::updateColumnWidths() S32 new_width = column->getWidth(); if (column->mRelWidth >= 0) { - new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth()); + new_width = (S32)llmath::llround(column->mRelWidth*mItemListRect.getWidth()); } else if (column->mDynamicWidth) { @@ -2829,7 +2829,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params } if (new_column->mRelWidth >= 0) { - new_column->setWidth((S32)llround(new_column->mRelWidth*mItemListRect.getWidth())); + new_column->setWidth((S32)llmath::llround(new_column->mRelWidth*mItemListRect.getWidth())); } else if(new_column->mDynamicWidth) { diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 489f71282..5944d0c11 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -147,7 +147,7 @@ F32 clamp_precision(F32 value, S32 decimal_precision) for (S32 i = 0; i < decimal_precision; i++) clamped_value *= 10.0; - clamped_value = llround((F32)clamped_value); + clamped_value = llmath::llround((F32)clamped_value); for (S32 i = 0; i < decimal_precision; i++) clamped_value /= 10.0; @@ -161,13 +161,13 @@ F32 get_increment(F32 inc, S32 decimal_precision) //CF: finetune increments if(gKeyboard->getKeyDown(KEY_ALT)) inc = inc * 10.f; else if(gKeyboard->getKeyDown(KEY_CONTROL)) { - if (llround(inc * 1000.f) == 25) // 0.025 gets 0.05 here + if (llmath::llround(inc * 1000.f) == 25) // 0.025 gets 0.05 here inc = inc * 0.2f; else inc = inc * 0.1f; } else if(gKeyboard->getKeyDown(KEY_SHIFT)) { - if (decimal_precision == 2 && llround(inc) == 1) // for rotations, finest step is 0.05 + if (decimal_precision == 2 && llmath::llround(inc) == 1) // for rotations, finest step is 0.05 inc = inc * 0.05f; else inc = inc * 0.01f; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 2e3be1803..c271e1706 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -120,7 +120,7 @@ void LLStatGraph::draw() color = mThresholdColors[i]; gGL.color4fv(color.mV); - gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE); + gl_rect_2d(1, llmath::llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE); } void LLStatGraph::setValue(const LLSD& value) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 08989e628..4c210cb14 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -312,7 +312,7 @@ LLTextEditor::LLTextEditor( updateTextRect(); - S32 line_height = llround( mGLFont->getLineHeight() ); + S32 line_height = llmath::llround( mGLFont->getLineHeight() ); S32 page_size = mTextRect.getHeight() / line_height; // Init the scrollbar @@ -970,7 +970,7 @@ S32 LLTextEditor::getCursorPosFromLocalCoord( S32 local_x, S32 local_y, BOOL rou // Figure out which line we're nearest to. S32 total_lines = getLineCount(); - S32 line_height = llround( mGLFont->getLineHeight() ); + S32 line_height = llmath::llround( mGLFont->getLineHeight() ); S32 max_visible_lines = mTextRect.getHeight() / line_height; S32 scroll_lines = mScrollbar->getDocPos(); S32 visible_lines = llmin( total_lines - scroll_lines, max_visible_lines ); // Lines currently visible @@ -2927,7 +2927,7 @@ void LLTextEditor::drawSelectionBackground() const S32 text_len = getLength(); std::queue line_endings; - S32 line_height = llround( mGLFont->getLineHeight() ); + S32 line_height = llmath::llround( mGLFont->getLineHeight() ); S32 selection_left = llmin( mSelectionStart, mSelectionEnd ); S32 selection_right = llmax( mSelectionStart, mSelectionEnd ); @@ -3122,7 +3122,7 @@ void LLTextEditor::drawMisspelled() S32 line_end = 0; // Determine if the cursor is visible and if so what its coordinates are. - while( (mTextRect.mBottom <= llround(text_y)) && (search_pos < num_lines)) + while( (mTextRect.mBottom <= llmath::llround(text_y)) && (search_pos < num_lines)) { line_end = text_len + 1; S32 next_line = -1; @@ -3197,7 +3197,7 @@ void LLTextEditor::drawCursor() S32 line_end = 0; // Determine if the cursor is visible and if so what its coordinates are. - while( (mTextRect.mBottom <= llround(text_y)) && (cur_pos < num_lines)) + while( (mTextRect.mBottom <= llmath::llround(text_y)) && (cur_pos < num_lines)) { line_end = text_len + 1; S32 next_line = -1; @@ -3316,7 +3316,7 @@ void LLTextEditor::drawPreeditMarker() return; } - const S32 line_height = llround( mGLFont->getLineHeight() ); + const S32 line_height = llmath::llround( mGLFont->getLineHeight() ); S32 line_start = getLineStart(cur_line); S32 line_y = mTextRect.mTop - line_height; @@ -3436,7 +3436,7 @@ void LLTextEditor::drawText() if (seg_iter == mSegments.end() || (*seg_iter)->getStart() > line_start) --seg_iter; LLTextSegment* cur_segment = *seg_iter; - S32 line_height = llround( mGLFont->getLineHeight() ); + S32 line_height = llmath::llround( mGLFont->getLineHeight() ); F32 text_y = (F32)(mTextRect.mTop - line_height); while((mTextRect.mBottom <= text_y) && (cur_line < num_lines)) { @@ -3461,7 +3461,7 @@ void LLTextEditor::drawText() if( mShowLineNumbers && !cur_line_is_continuation) { const LLFontGL *num_font = LLFontGL::getFontMonospace(); - F32 y_top = text_y + ((F32)llround(num_font->getLineHeight()) / 2); + F32 y_top = text_y + ((F32)llmath::llround(num_font->getLineHeight()) / 2); const LLWString ltext = utf8str_to_wstring(llformat("%*d", UI_TEXTEDITOR_LINE_NUMBER_DIGITS, cur_line_num )); BOOL is_cur_line = getCurrentLine() == cur_line_num; const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL; @@ -3505,7 +3505,7 @@ void LLTextEditor::drawText() S32 style_image_height = style->mImageHeight; S32 style_image_width = style->mImageWidth; LLUIImagePtr image = style->getImage(); - image->draw(llround(text_x), llround(text_y)+line_height-style_image_height, + image->draw(llmath::llround(text_x), llmath::llround(text_y)+line_height-style_image_height, style_image_width, style_image_height); } @@ -3592,7 +3592,7 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 } } - F32 y_top = y + (F32)llround(font->getLineHeight()); + F32 y_top = y + (F32)llmath::llround(font->getLineHeight()); if( selection_left > seg_start ) { @@ -3995,7 +3995,7 @@ void LLTextEditor::reshape(S32 width, S32 height, BOOL called_from_parent) // propagate shape information to scrollbar mScrollbar->setDocSize( getLineCount() ); - S32 line_height = llround( mGLFont->getLineHeight() ); + S32 line_height = llmath::llround( mGLFont->getLineHeight() ); S32 page_lines = mTextRect.getHeight() / line_height; mScrollbar->setPageSize( page_lines ); } @@ -5162,7 +5162,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect } const llwchar * const text = mWText.c_str(); - const S32 line_height = llround(mGLFont->getLineHeight()); + const S32 line_height = llmath::llround(mGLFont->getLineHeight()); if (coord) { @@ -5265,7 +5265,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length) S32 LLTextEditor::getPreeditFontSize() const { - return llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); + return llmath::llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]); } void LLTextEditor::setKeystrokeCallback(const keystroke_signal_t::slot_type& callback) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index aab2df83f..39f4598c5 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -158,8 +158,8 @@ void LLUI::cleanupClass() void LLUI::setMousePositionScreen(S32 x, S32 y) { S32 screen_x, screen_y; - screen_x = llround((F32)x * getScaleFactor().mV[VX]); - screen_y = llround((F32)y * getScaleFactor().mV[VY]); + screen_x = llmath::llround((F32)x * getScaleFactor().mV[VX]); + screen_y = llmath::llround((F32)y * getScaleFactor().mV[VY]); LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } @@ -170,8 +170,8 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y) LLCoordWindow cursor_pos_window; getWindow()->getCursorPosition(&cursor_pos_window); LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); - *x = llround((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); - *y = llround((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]); + *x = llmath::llround((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); + *y = llmath::llround((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]); } //static @@ -262,15 +262,15 @@ LLVector2 LLUI::getWindowSize() //static void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y) { - *gl_x = llround((F32)screen_x * getScaleFactor().mV[VX]); - *gl_y = llround((F32)screen_y * getScaleFactor().mV[VY]); + *gl_x = llmath::llround((F32)screen_x * getScaleFactor().mV[VX]); + *gl_y = llmath::llround((F32)screen_y * getScaleFactor().mV[VY]); } //static void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y) { - *screen_x = llround((F32)gl_x / getScaleFactor().mV[VX]); - *screen_y = llround((F32)gl_y / getScaleFactor().mV[VY]); + *screen_x = llmath::llround((F32)gl_x / getScaleFactor().mV[VX]); + *screen_y = llmath::llround((F32)gl_y / getScaleFactor().mV[VY]); } //static diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index d4c83d674..fe5d80bb1 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -821,9 +821,9 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data) // If parcel name is empty use Sim_name (x, y, z) for parcel label. else if (!parcel_data.sim_name.empty()) { - S32 region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; - S32 region_z = llround(parcel_data.global_z); + S32 region_x = llmath::llround(parcel_data.global_x) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround(parcel_data.global_y) % REGION_WIDTH_UNITS; + S32 region_z = llmath::llround(parcel_data.global_z); label = llformat("%s (%d, %d, %d)", parcel_data.sim_name.c_str(), region_x, region_y, region_z); diff --git a/indra/newview/aihttpview.cpp b/indra/newview/aihttpview.cpp index d3de57171..5c0ac97a6 100644 --- a/indra/newview/aihttpview.cpp +++ b/indra/newview/aihttpview.cpp @@ -190,7 +190,7 @@ class AIGLHTTPHeaderBar : public LLView AIGLHTTPHeaderBar(std::string const& name, AIHTTPView* httpview) : LLView(name, FALSE), mHTTPView(httpview) { - sLineHeight = llround(LLFontGL::getFontMonospace()->getLineHeight()); + sLineHeight = llmath::llround(LLFontGL::getFontMonospace()->getLineHeight()); setRect(LLRect(0, 0, 200, sLineHeight * number_of_header_lines)); } diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp index fcdfbecd4..12c260b87 100644 --- a/indra/newview/llcloud.cpp +++ b/indra/newview/llcloud.cpp @@ -189,7 +189,7 @@ void LLCloudGroup::updatePuffCount() return; } S32 i; - S32 target_puff_count = llround(CLOUD_DENSITY * mDensity); + S32 target_puff_count = llmath::llround(CLOUD_DENSITY * mDensity); target_puff_count = llmax(0, target_puff_count); target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count); S32 current_puff_count = (S32) mCloudPuffs.size(); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 56fe132d3..449753b47 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -812,7 +812,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = llmath::llround(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 0a0a2d610..fcebf26e7 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1309,7 +1309,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(maximum - i) * twice_one_over_range - 1.f; - bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); + bias_and_scale_lut[i] = llclampb(llmath::llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); } } else @@ -1318,7 +1318,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI for( i = minimum; i <= maximum; i++ ) { F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f; - bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); + bias_and_scale_lut[i] = llclampb(llmath::llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128)); } } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 30864755c..eb360e120 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -256,7 +256,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) if (hasMouseCapture()) { F32 lerp = llclamp(1.f - (F32) (x - mGraphRect.mLeft) / (F32) mGraphRect.getWidth(), 0.f, 1.f); - mScrollIndex = llround( lerp * (F32)(LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); + mScrollIndex = llmath::llround( lerp * (F32)(LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); mScrollIndex = llclamp( mScrollIndex, 0, LLFastTimer::getLastFrameIndex()); return TRUE; } @@ -298,9 +298,9 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } mToolTipRect.set(mBarStart[mHoverBarIndex][i], - mBarRect.mBottom + llround(((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex + 1)) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))), + mBarRect.mBottom + llmath::llround(((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex + 1)) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))), mBarEnd[mHoverBarIndex][i], - mBarRect.mBottom + llround((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f)))); + mBarRect.mBottom + llmath::llround((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f)))); } if ((*it)->getCollapsed()) @@ -432,7 +432,7 @@ void LLFastTimerView::draw() mAverageCyclesPerTimer = LLFastTimer::sTimerCalls == 0 ? 0 - : llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); + : llmath::llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); LLFastTimer::sTimerCycles = 0; LLFastTimer::sTimerCalls = 0; @@ -800,7 +800,7 @@ void LLFastTimerView::draw() ? (F32)idp->getCountAverage() / (F32)totalticks : (F32)idp->getHistoricalCount(tidx) / (F32)totalticks; - dx = llround(frac * (F32)barw); + dx = llmath::llround(frac * (F32)barw); S32 prev_delta_x = deltax.empty() ? 0 : deltax.back(); deltax.push_back(dx); diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index cf97d4e82..1bcf79278 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -302,7 +302,7 @@ void LLVolumeImplFlexible::updateRenderRes() mRenderRes = (S32) (12.f*app_angle); #else //legacy behavior //number of segments only cares about z axis - F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); + F32 app_angle = llmath::llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); // Rendering sections increases with visible angle on the screen mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView()); diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index b955e31fb..86ed6505f 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -386,9 +386,9 @@ void LLFloaterBuyLandUI::updateParcelInfo() } mParcelBillableArea = - llround(mRegion->getBillableFactor() * mParcelActualArea); + llmath::llround(mRegion->getBillableFactor() * mParcelActualArea); - mParcelSupportedObjects = llround( + mParcelSupportedObjects = llmath::llround( parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); // Can't have more than region max tasks, regardless of parcel // object bonus factor. diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 09f6ff402..c54a62545 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -316,7 +316,7 @@ std::string LLFloaterEnvSettings::timeToString(F32 curTime) // get hours and minutes hours = (S32) (24.0 * curTime); curTime -= ((F32) hours / 24.0f); - min = llround(24.0f * 60.0f * curTime); + min = llmath::llround(24.0f * 60.0f * curTime); // handle case where it's 60 if(min == 60) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d76a43566..6c68e27d6 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1203,7 +1203,7 @@ void LLPanelLandObjects::refresh() { S32 sw_max = parcel->getSimWideMaxPrimCapacity(); S32 sw_total = parcel->getSimWidePrimCount(); - S32 max = llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); + S32 max = llmath::llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); S32 total = parcel->getPrimCount(); S32 owned = parcel->getOwnerPrimCount(); S32 group = parcel->getGroupPrimCount(); @@ -2081,9 +2081,9 @@ void LLPanelLandOptions::refresh() else { mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d", - llround(pos.mV[VX]), - llround(pos.mV[VY]), - llround(pos.mV[VZ]))); + llmath::llround(pos.mV[VX]), + llmath::llround(pos.mV[VY]), + llmath::llround(pos.mV[VZ]))); } mSetBtn->setEnabled( can_change_landing_point ); diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index 4949678c1..405983590 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -226,8 +226,8 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**) self->mActualArea += actual_area; self->mBillableArea += billable_area; - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_x = llmath::llround(global_x) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround(global_y) % REGION_WIDTH_UNITS; std::string location; location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y); diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index d5e7fc089..d335b9566 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -219,7 +219,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa columns[2]["column"] = "owner"; columns[2]["value"] = getOwnerName(pCharacterPtr); - S32 cpuTime = llround(pCharacterPtr->getCPUTime()); + S32 cpuTime = llmath::llround(pCharacterPtr->getCPUTime()); std::string cpuTimeString = llformat("%d", cpuTime); LLStringUtil::format_map_t string_args; string_args["[CPU_TIME]"] = cpuTimeString; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 9d7e2c0be..ceda09814 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -493,16 +493,16 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail if (mAspectRatio > window_aspect_ratio) { // trim off top and bottom - S32 height_diff = llround(getRect().getHeight() - (F32)getRect().getWidth() / mAspectRatio); - S32 half_height_diff = llround((getRect().getHeight() - (F32)getRect().getWidth() / mAspectRatio) * 0.5); + S32 height_diff = llmath::llround(getRect().getHeight() - (F32)getRect().getWidth() / mAspectRatio); + S32 half_height_diff = llmath::llround((getRect().getHeight() - (F32)getRect().getWidth() / mAspectRatio) * 0.5); rect.mBottom += half_height_diff; rect.mTop -= height_diff - half_height_diff; } else if (mAspectRatio < window_aspect_ratio) { // trim off left and right - S32 width_diff = llround(getRect().getWidth() - (F32)getRect().getHeight() * mAspectRatio); - S32 half_width_diff = llround((getRect().getWidth() - (F32)getRect().getHeight() * mAspectRatio) * 0.5f); + S32 width_diff = llmath::llround(getRect().getWidth() - (F32)getRect().getHeight() * mAspectRatio); + S32 half_width_diff = llmath::llround((getRect().getWidth() - (F32)getRect().getHeight() * mAspectRatio) * 0.5f); rect.mLeft += half_width_diff; rect.mRight -= width_diff - half_width_diff; } @@ -639,9 +639,9 @@ void LLSnapshotLivePreview::draw() LLLocalClipRect clip(getLocalRect()); { // draw diagonal stripe with gradient that passes over screen - S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); - S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); - S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x1 = gViewerWindow->getWindowWidthScaled() * llmath::llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); + S32 x2 = x1 + llmath::llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x3 = x2 + llmath::llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); S32 y1 = 0; S32 y2 = gViewerWindow->getWindowHeightScaled(); @@ -719,7 +719,7 @@ void LLSnapshotLivePreview::draw() gGL.pushMatrix(); { LLRect const& rect = mFallFullScreenImageRect; - gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); + gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llmath::llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); gGL.begin(LLRender::QUADS); { @@ -772,13 +772,13 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() { // image too wide, shrink to width mThumbnailWidth = max_width; - mThumbnailHeight = llround((F32)max_width / window_aspect_ratio); + mThumbnailHeight = llmath::llround((F32)max_width / window_aspect_ratio); } else { // image too tall, shrink to height mThumbnailHeight = max_height; - mThumbnailWidth = llround((F32)max_height * window_aspect_ratio); + mThumbnailWidth = llmath::llround((F32)max_height * window_aspect_ratio); } if(mThumbnailWidth > window_width || mThumbnailHeight > window_height) @@ -790,11 +790,11 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() F32 ratio = mAspectRatio * window_height / window_width; if(ratio > 1.f) { - top = llround(top / ratio); + top = llmath::llround(top / ratio); } else { - right = llround(right * ratio); + right = llmath::llround(right * ratio); } left = (mThumbnailWidth - right + 1) / 2; bottom = (mThumbnailHeight - top + 1) / 2; @@ -991,8 +991,8 @@ LLSnapshotLivePreview::EAspectSizeProblem LLSnapshotLivePreview::getAspectSizePr // We need an image with the aspect mAspectRatio (from which mWidth and mHeight were derived). // The current aspect ratio of mRawSnapshot. This should be (almost) equal to window_width / window_height, - // since these values are calculated in rawRawSnapshot with llround(window_width * scale_factor) and - // llround(window_height * scale_factor) respectively (since we set uncrop = true). + // since these values are calculated in rawRawSnapshot with llmath::llround(window_width * scale_factor) and + // llmath::llround(window_height * scale_factor) respectively (since we set uncrop = true). F32 raw_aspect = (F32)mRawSnapshotWidth / mRawSnapshotHeight; // The smaller dimension might have been rounded up to 0.5 up or down. Calculate upper and lower limits. F32 lower_raw_aspect = (mRawSnapshotWidth - 0.5) / (mRawSnapshotHeight + 0.5); @@ -1017,7 +1017,7 @@ LLSnapshotLivePreview::EAspectSizeProblem LLSnapshotLivePreview::getAspectSizePr height_out = mRawSnapshotHeight; if (mAspectRatio < lower_raw_aspect) { - width_out = llround(width_out * mAspectRatio / raw_aspect); + width_out = llmath::llround(width_out * mAspectRatio / raw_aspect); if (width_out < mRawSnapshotWidth) { // Only set this to false when there is actually something to crop. @@ -1033,7 +1033,7 @@ LLSnapshotLivePreview::EAspectSizeProblem LLSnapshotLivePreview::getAspectSizePr } else if (mAspectRatio > upper_raw_aspect) { - height_out = llround(height_out * raw_aspect / mAspectRatio); + height_out = llmath::llround(height_out * raw_aspect / mAspectRatio); if (height_out < mRawSnapshotHeight) { if (!allow_vertical_crop) @@ -2403,8 +2403,8 @@ void LLFloaterSnapshot::Impl::keepAspect(LLFloaterSnapshot* view, bool on, bool LLSnapshotLivePreview* previewp = getPreviewView(); if (previewp) { - S32 w = llround(view->childGetValue("snapshot_width").asReal(), 1.0); - S32 h = llround(view->childGetValue("snapshot_height").asReal(), 1.0); + S32 w = llmath::llround(view->childGetValue("snapshot_width").asReal(), 1.0); + S32 h = llmath::llround(view->childGetValue("snapshot_height").asReal(), 1.0); gSavedSettings.setS32(lastSnapshotWidthName(), w); gSavedSettings.setS32(lastSnapshotHeightName(), h); comboSetCustom(view, previewp->resolutionComboName()); @@ -2464,8 +2464,8 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, bool // The size is actually the source aspect now, encoded in the width. F32 source_aspect = width / 630.f; // Use the size of the current window, cropped to the required aspect. - width = llmin(gViewerWindow->getWindowDisplayWidth(), llround(gViewerWindow->getWindowDisplayHeight() * source_aspect)); - height = llmin(gViewerWindow->getWindowDisplayHeight(), llround(gViewerWindow->getWindowDisplayWidth() / source_aspect)); + width = llmin(gViewerWindow->getWindowDisplayWidth(), llmath::llround(gViewerWindow->getWindowDisplayHeight() * source_aspect)); + height = llmin(gViewerWindow->getWindowDisplayHeight(), llmath::llround(gViewerWindow->getWindowDisplayWidth() / source_aspect)); previewp->setSize(width, height); } else @@ -2652,8 +2652,8 @@ void LLFloaterSnapshot::Impl::enforceResolution(LLFloaterSnapshot* floater, F32 nw = llmin(nw, nh * new_aspect); nh = llmin(nh, nw / new_aspect); // Round off to nearest integer. - S32 new_width = llround(nw); - S32 new_height = llround(nh); + S32 new_width = llmath::llround(nw); + S32 new_height = llmath::llround(nh); gSavedSettings.setS32(lastSnapshotWidthName(), new_width); gSavedSettings.setS32(lastSnapshotHeightName(), new_height); @@ -2754,8 +2754,8 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat LLSpinCtrl* width_spinner = view->getChild("snapshot_width"); LLSpinCtrl* height_spinner = view->getChild("snapshot_height"); - S32 w = llround((F32)width_spinner->getValue().asReal(), 1.0f); - S32 h = llround((F32)height_spinner->getValue().asReal(), 1.0f); + S32 w = llmath::llround((F32)width_spinner->getValue().asReal(), 1.0f); + S32 h = llmath::llround((F32)height_spinner->getValue().asReal(), 1.0f); LLSnapshotLivePreview* previewp = getPreviewView(); if (previewp) @@ -2782,12 +2782,12 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat if (h == curh) { // Width was changed. Change height to keep aspect constant. - h = llround(w / aspect); + h = llmath::llround(w / aspect); } else { // Height was changed. Change width to keep aspect constant. - w = llround(h * aspect); + w = llmath::llround(h * aspect); } } width_spinner->forceSetValue(LLSD::Real(w)); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 1d33194a0..c930fa461 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -710,9 +710,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) // std::string full_name = llformat("%s (%d, %d, %d)", sim_name.c_str(), - llround(region_x), - llround(region_y), - llround((F32)pos_global.mdV[VZ])); + llmath::llround(region_x), + llmath::llround(region_y), + llmath::llround((F32)pos_global.mdV[VZ])); std::string tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 8e36725c8..14259fe99 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -535,7 +535,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen updateRenamerPosition(); mTargetHeight = (F32)target_height; - return llround(mTargetHeight); + return llmath::llround(mTargetHeight); } const std::string LLFolderView::getFilterSubString(BOOL trim) @@ -2041,7 +2041,7 @@ void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constr LLRect item_scrolled_rect; // item position relative to display area of scroller S32 icon_height = mIcon.isNull() ? 0 : mIcon->getHeight(); - S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); + S32 label_height = llmath::llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); // when navigating with keyboard, only move top of opened folder on screen, otherwise show whole folder S32 max_height_to_show = item->isOpen() && mScrollContainer->hasFocus() ? (llmax( icon_height, label_height ) + ICON_PAD) : local_rect.getHeight(); diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 52c6cd998..3014bf180 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1088,7 +1088,7 @@ void LLFolderViewItem::draw() if (filter_string_length > 0 && (mRoot->getSearchType() & 1)) { std::string combined_string = mLabel + mLabelSuffix; - S32 left = llround(text_left) + font->getWidth(combined_string, 0, mStringMatchOffset) - 1; + S32 left = llmath::llround(text_left) + font->getWidth(combined_string, 0, mStringMatchOffset) - 1; S32 right = left + font->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD); S32 top = getRect().getHeight() - TOP_PAD; @@ -1225,7 +1225,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) { S32 child_width = *width; S32 child_height = 0; - S32 child_top = parent_item_height - llround(running_height); + S32 child_top = parent_item_height - llmath::llround(running_height); target_height += folderp->arrange( &child_width, &child_height, filter_generation ); @@ -1251,7 +1251,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) { S32 child_width = *width; S32 child_height = 0; - S32 child_top = parent_item_height - llround(running_height); + S32 child_top = parent_item_height - llmath::llround(running_height); target_height += itemp->arrange( &child_width, &child_height, filter_generation ); // don't change width, as this item is as wide as its parent folder by construction @@ -1288,7 +1288,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) folders_t::iterator fit = iter++; // number of pixels that bottom of folder label is from top of parent folder if (getRect().getHeight() - (*fit)->getRect().mTop + (*fit)->getItemHeight() - > llround(mCurHeight) + MAX_FOLDER_ITEM_OVERLAP) + > llmath::llround(mCurHeight) + MAX_FOLDER_ITEM_OVERLAP) { // hide if beyond current folder height (*fit)->setVisible(FALSE); @@ -1301,7 +1301,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) items_t::iterator iit = iter++; // number of pixels that bottom of item label is from top of parent folder if (getRect().getHeight() - (*iit)->getRect().mBottom - > llround(mCurHeight) + MAX_FOLDER_ITEM_OVERLAP) + > llmath::llround(mCurHeight) + MAX_FOLDER_ITEM_OVERLAP) { (*iit)->setVisible(FALSE); } @@ -1313,12 +1313,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) } // don't change width as this item is already as wide as its parent folder - reshape(getRect().getWidth(),llround(mCurHeight)); + reshape(getRect().getWidth(),llmath::llround(mCurHeight)); // pass current height value back to parent - *height = llround(mCurHeight); + *height = llmath::llround(mCurHeight); - return llround(mTargetHeight); + return llmath::llround(mTargetHeight); } BOOL LLFolderViewFolder::needsArrange() diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 53caaee64..c951fe953 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -100,10 +100,10 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 top = llmax(y, mDragStartY); S32 bottom =llmin(y, mDragStartY); - left = llround((F32) left * LLUI::getScaleFactor().mV[VX]); - right = llround((F32) right * LLUI::getScaleFactor().mV[VX]); - top = llround((F32) top * LLUI::getScaleFactor().mV[VY]); - bottom = llround((F32) bottom * LLUI::getScaleFactor().mV[VY]); + left = llmath::llround((F32) left * LLUI::getScaleFactor().mV[VX]); + right = llmath::llround((F32) right * LLUI::getScaleFactor().mV[VX]); + top = llmath::llround((F32) top * LLUI::getScaleFactor().mV[VY]); + bottom = llmath::llround((F32) bottom * LLUI::getScaleFactor().mV[VY]); F32 old_far_plane = LLViewerCamera::getInstance()->getFar(); F32 old_near_plane = LLViewerCamera::getInstance()->getNear(); diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index f83e14e9b..c0f606414 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -538,8 +538,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string std::string val_string; std::string fraction_string; - F32 val_to_print = llround(value, 0.001f); - S32 fractional_portion = llround(fmodf(llabs(val_to_print), 1.f) * 100.f); + F32 val_to_print = llmath::llround(value, 0.001f); + S32 fractional_portion = llmath::llround(fmodf(llabs(val_to_print), 1.f) * 100.f); if (val_to_print < 0.f) { if (fractional_portion == 0) diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index b04c0260e..5c160e5b6 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -373,9 +373,9 @@ void LLManipRotate::render() LLQuaternion object_rot = first_object->getRotationEdit(); object_rot.getEulerAngles(&(euler_angles.mV[VX]), &(euler_angles.mV[VY]), &(euler_angles.mV[VZ])); euler_angles *= RAD_TO_DEG; - euler_angles.mV[VX] = llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f); - euler_angles.mV[VY] = llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f); - euler_angles.mV[VZ] = llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f); + euler_angles.mV[VX] = llmath::llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f); + euler_angles.mV[VY] = llmath::llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f); + euler_angles.mV[VZ] = llmath::llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f); renderXYZ(euler_angles); } @@ -1500,7 +1500,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); + //fmodf(llmath::llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); LLVector3 object_axis; getObjectAxisClosestToMouse(object_axis); @@ -1584,7 +1584,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); + //fmodf(llmath::llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); LLVector3 object_axis; getObjectAxisClosestToMouse(object_axis); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 3ef134ee0..1a40a9e12 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1559,8 +1559,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir); mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir); - mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); - mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); + mTickPixelSpacing1 = llmath::llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); + mTickPixelSpacing2 = llmath::llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); if (uniform) { @@ -1632,8 +1632,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2); // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1); - S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2); + S32 sub_div_offset_1 = llmath::llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1); + S32 sub_div_offset_2 = llmath::llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2); S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision1)); S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision2)); @@ -1687,7 +1687,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normalize(); - S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); + S32 tick_label_spacing = llmath::llround(screen_translate_axis * sTickLabelSpacing); for (pass = 0; pass < 3; pass++) { @@ -1767,8 +1767,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) stop_tick = llmin(max_ticks1, num_ticks_per_side1); F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); - S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); - S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); + S32 label_sub_div_offset_1 = llmath::llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); + S32 label_sub_div_offset_2 = llmath::llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); for (S32 i = start_tick; i <= stop_tick; i++) { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index b066e5275..3be734b62 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1263,7 +1263,7 @@ void LLManipTranslate::renderSnapGuides() // find distance to nearest smallest grid unit F32 offset_nearest_grid_unit = fmodf(dist_grid_axis, smallest_grid_unit_scale); // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset = llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale); + S32 sub_div_offset = llmath::llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale); S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale)); LLGLDepthTest gls_depth(GL_FALSE); @@ -1377,12 +1377,12 @@ void LLManipTranslate::renderSnapGuides() } } - sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); + sub_div_offset = llmath::llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normVec(); - S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); + S32 tick_label_spacing = llmath::llround(screen_translate_axis * sTickLabelSpacing); // render tickmark values for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++) @@ -1420,7 +1420,7 @@ void LLManipTranslate::renderSnapGuides() F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale(); EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode(); F32 text_highlight = 0.8f; - if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) + if(i - llmath::llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) { text_highlight = 1.f; } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 80ed404d3..02189151d 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -120,8 +120,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); - S32 screen_height = llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); + S32 screen_width = llmath::llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = llmath::llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]); setTextureSize(screen_width, screen_height); } @@ -464,8 +464,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent ) { if(!getDecoupleTextureSize()) { - S32 screen_width = llround((F32)width * LLUI::getScaleFactor().mV[VX]); - S32 screen_height = llround((F32)height * LLUI::getScaleFactor().mV[VY]); + S32 screen_width = llmath::llround((F32)width * LLUI::getScaleFactor().mV[VX]); + S32 screen_height = llmath::llround((F32)height * LLUI::getScaleFactor().mV[VY]); // when floater is minimized, these sizes are negative if ( screen_height > 0 && screen_width > 0 ) @@ -794,13 +794,13 @@ void LLMediaCtrl::draw() { // max width, adjusted height width = r.getWidth(); - height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight()); + height = llmin(llmax(llmath::llround(width / media_aspect), 0), r.getHeight()); } else { // max height, adjusted width height = r.getHeight(); - width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth()); + width = llmin(llmax(llmath::llround(height * media_aspect), 0), r.getWidth()); } } else @@ -820,10 +820,10 @@ void LLMediaCtrl::draw() /*if (mIgnoreUIScale) { - x_offset = llround((F32)x_offset * LLUI::getScaleFactor().mV[VX]); - y_offset = llround((F32)y_offset * LLUI::getScaleFactor().mV[VY]); - width = llround((F32)width * LLUI::getScaleFactor().mV[VX]); - height = llround((F32)height * LLUI::getScaleFactor().mV[VY]); + x_offset = llmath::llround((F32)x_offset * LLUI::getScaleFactor().mV[VX]); + y_offset = llmath::llround((F32)y_offset * LLUI::getScaleFactor().mV[VY]); + width = llmath::llround((F32)width * LLUI::getScaleFactor().mV[VX]); + height = llmath::llround((F32)height * LLUI::getScaleFactor().mV[VY]); }*/ // draw the browser @@ -894,14 +894,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y) coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL(); } - x = llround((F32)x * LLUI::getScaleFactor().mV[VX]); + x = llmath::llround((F32)x * LLUI::getScaleFactor().mV[VX]); if ( ! coords_opengl ) { - y = llround((F32)(y) * LLUI::getScaleFactor().mV[VY]); + y = llmath::llround((F32)(y) * LLUI::getScaleFactor().mV[VY]); } else { - y = llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); + y = llmath::llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]); }; } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 93b204759..40ba95dd7 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -314,7 +314,7 @@ void LLNetMap::draw() static const LLCachedControl live_region_color(gColors, "NetMapLiveRegion"); static const LLCachedControl dead_region_color(gColors, "NetMapDeadRegion"); // Aurora Sim - //S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); + //S32 region_width = llmath::llround(LLWorld::getInstance()->getRegionWidthInMeters()); S32 region_width = REGION_WIDTH_UNITS; // Aurora Sim @@ -638,8 +638,8 @@ void LLNetMap::draw() (pos_map.mV[VX] >= getRect().getWidth()) || (pos_map.mV[VY] >= getRect().getHeight()) ) { - S32 x = llround( pos_map.mV[VX] ); - S32 y = llround( pos_map.mV[VY] ); + S32 x = llmath::llround( pos_map.mV[VX] ); + S32 y = llmath::llround( pos_map.mV[VY] ); LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10); } @@ -675,13 +675,13 @@ void LLNetMap::draw() } pos_map = globalPosToView(gAgent.getPositionGlobal()); - S32 dot_width = llround(mDotRadius * 2.f); + S32 dot_width = llmath::llround(mDotRadius * 2.f); LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; if (you) { - you->draw(llround(pos_map.mV[VX] - mDotRadius), - llround(pos_map.mV[VY] - mDotRadius), + you->draw(llmath::llround(pos_map.mV[VX] - mDotRadius), + llmath::llround(pos_map.mV[VY] - mDotRadius), dot_width, dot_width); @@ -844,8 +844,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, { if (draw_arrow) { - S32 x = llround( pos_local.mV[VX] ); - S32 y = llround( pos_local.mV[VY] ); + S32 x = llmath::llround( pos_local.mV[VX] ); + S32 y = llmath::llround( pos_local.mV[VY] ); LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10 ); LLWorldMapView::drawTrackingArrow( getRect(), x, y, color ); } @@ -861,8 +861,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) { - x -= llround(getRect().getWidth() / 2 + mCurPan.mV[VX]); - y -= llround(getRect().getHeight() / 2 + mCurPan.mV[VY]); + x -= llmath::llround(getRect().getWidth() / 2 + mCurPan.mV[VX]); + y -= llmath::llround(getRect().getHeight() / 2 + mCurPan.mV[VY]); LLVector3 pos_local( (F32)x, (F32)y, 0 ); @@ -1008,8 +1008,8 @@ void LLNetMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) // Inset by a little to account for position display. radius -= 8.f; - text_box->setOrigin(llround(half_width + radius * cos( rotation )), - llround(half_height + radius * sin( rotation ))); + text_box->setOrigin(llmath::llround(half_width + radius * cos( rotation )), + llmath::llround(half_height + radius * sin( rotation ))); } void LLNetMap::updateMinorDirections() @@ -1038,7 +1038,7 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U & const F32 MAX_RADIUS = 256.0f; F32 radius_clamped = llmin(radius_meters, MAX_RADIUS); - S32 diameter_pixels = llround(2 * radius_clamped * mObjectMapTPM); + S32 diameter_pixels = llmath::llround(2 * radius_clamped * mObjectMapTPM); renderPoint( local_pos, color, diameter_pixels ); } @@ -1054,8 +1054,8 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color, const S32 image_width = (S32)mObjectImagep->getWidth(); const S32 image_height = (S32)mObjectImagep->getHeight(); - S32 x_offset = llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2); - S32 y_offset = llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2); + S32 x_offset = llmath::llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2); + S32 y_offset = llmath::llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2); if ((x_offset < 0) || (x_offset >= image_width)) { @@ -1135,25 +1135,25 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const const S32 imgHeight = (S32)mParcelImagep->getHeight(); const LLVector3 originLocal(pRegion->getOriginGlobal() - mParcelImageCenterGlobal); - const S32 originX = llround(originLocal.mV[VX] * mObjectMapTPM + imgWidth / 2); - const S32 originY = llround(originLocal.mV[VY] * mObjectMapTPM + imgHeight / 2); + const S32 originX = llmath::llround(originLocal.mV[VX] * mObjectMapTPM + imgWidth / 2); + const S32 originY = llmath::llround(originLocal.mV[VY] * mObjectMapTPM + imgHeight / 2); U32* pTextureData = (U32*)mParcelRawImagep->getData(); // // Draw the north and east region borders // - const S32 borderY = originY + llround(REGION_WIDTH_METERS * mObjectMapTPM); + const S32 borderY = originY + llmath::llround(REGION_WIDTH_METERS * mObjectMapTPM); if ( (borderY >= 0) && (borderY < imgHeight) ) { - S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgWidth - 1); + S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + llmath::llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgWidth - 1); for (; curX <= endX; curX++) pTextureData[borderY * imgWidth + curX] = clrOverlay.mAll; } - const S32 borderX = originX + llround(REGION_WIDTH_METERS * mObjectMapTPM); + const S32 borderX = originX + llmath::llround(REGION_WIDTH_METERS * mObjectMapTPM); if ( (borderX >= 0) && (borderX < imgWidth) ) { - S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgHeight - 1); + S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + llmath::llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgHeight - 1); for (; curY <= endY; curY++) pTextureData[curY * imgWidth + borderX] = clrOverlay.mAll; } @@ -1177,17 +1177,17 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const if ( (!fForSale) && (!fCollision) && (0 == (overlay & (PARCEL_SOUTH_LINE | PARCEL_WEST_LINE))) ) continue; - const S32 posX = originX + llround(idxCol * GRID_STEP * mObjectMapTPM); - const S32 posY = originY + llround(idxRow * GRID_STEP * mObjectMapTPM); + const S32 posX = originX + llmath::llround(idxCol * GRID_STEP * mObjectMapTPM); + const S32 posY = originY + llmath::llround(idxRow * GRID_STEP * mObjectMapTPM); static LLCachedControl s_fForSaleParcels(gSavedSettings, "MiniMapForSaleParcels"); static LLCachedControl s_fShowCollisionParcels(gSavedSettings, "MiniMapCollisionParcels"); if ( ((s_fForSaleParcels) && (fForSale)) || ((s_fShowCollisionParcels) && (fCollision)) ) { - S32 curY = llclamp(posY, 0, imgHeight), endY = llclamp(posY + llround(GRID_STEP * mObjectMapTPM), 0, imgHeight - 1); + S32 curY = llclamp(posY, 0, imgHeight), endY = llclamp(posY + llmath::llround(GRID_STEP * mObjectMapTPM), 0, imgHeight - 1); for (; curY <= endY; curY++) { - S32 curX = llclamp(posX, 0, imgWidth) , endX = llclamp(posX + llround(GRID_STEP * mObjectMapTPM), 0, imgWidth - 1); + S32 curX = llclamp(posX, 0, imgWidth) , endX = llclamp(posX + llmath::llround(GRID_STEP * mObjectMapTPM), 0, imgWidth - 1); for (; curX <= endX; curX++) { pTextureData[curY * imgWidth + curX] = (fForSale) ? LLColor4U(255, 255, 128, 192).mAll @@ -1199,7 +1199,7 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const { if ( (posY >= 0) && (posY < imgHeight) ) { - S32 curX = llclamp(posX, 0, imgWidth), endX = llclamp(posX + llround(GRID_STEP * mObjectMapTPM), 0, imgWidth - 1); + S32 curX = llclamp(posX, 0, imgWidth), endX = llclamp(posX + llmath::llround(GRID_STEP * mObjectMapTPM), 0, imgWidth - 1); for (; curX <= endX; curX++) pTextureData[posY * imgWidth + curX] = clrOverlay.mAll; } @@ -1208,7 +1208,7 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const { if ( (posX >= 0) && (posX < imgWidth) ) { - S32 curY = llclamp(posY, 0, imgHeight), endY = llclamp(posY + llround(GRID_STEP * mObjectMapTPM), 0, imgHeight - 1); + S32 curY = llclamp(posY, 0, imgHeight), endY = llclamp(posY + llmath::llround(GRID_STEP * mObjectMapTPM), 0, imgHeight - 1); for (; curY <= endY; curY++) pTextureData[curY * imgWidth + posX] = clrOverlay.mAll; } @@ -1227,7 +1227,7 @@ bool LLNetMap::createImage(LLPointer& rawimagep) const // ... which is, the diagonal of the rect. F32 width = (F32)getRect().getWidth(); F32 height = (F32)getRect().getHeight(); - S32 square_size = llround( sqrt(width*width + height*height) ); + S32 square_size = llmath::llround( sqrt(width*width + height*height) ); // Find the least power of two >= the minimum size. const S32 MIN_SIZE = 64; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 766cbe50c..b08150b57 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -332,9 +332,9 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t if (!location_text.empty()) location_text.append(", "); - S32 region_x = llround((F32)c_info->pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)c_info->pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)c_info->pos_global.mdV[VZ]); + S32 region_x = llmath::llround((F32)c_info->pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround((F32)c_info->pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llmath::llround((F32)c_info->pos_global.mdV[VZ]); std::string buffer = llformat("%s (%d, %d, %d)", c_info->sim_name.c_str(), region_x, region_y, region_z); location_text.append(buffer); @@ -893,9 +893,9 @@ void LLPanelClassifiedInfo::onClickSet() location_text.assign(regionName); location_text.append(", "); - S32 region_x = llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)mPosGlobal.mdV[VZ]); + S32 region_x = llmath::llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llmath::llround((F32)mPosGlobal.mdV[VZ]); location_text.append(mSimName); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 1d4e23ded..19fe7218c 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -904,8 +904,8 @@ void LLPanelDisplay::fractionFromDecimal(F32 decimal_val, S32& numerator, S32& d { if (fmodf((decimal_val * test_denominator) + 0.01f, 1.f) < 0.02f) { - numerator = llround(decimal_val * test_denominator); - denominator = llround(test_denominator); + numerator = llmath::llround(decimal_val * test_denominator); + denominator = llmath::llround(test_denominator); break; } } diff --git a/indra/newview/llpanelevent.cpp b/indra/newview/llpanelevent.cpp index ef25b25e9..6b57f1cf9 100644 --- a/indra/newview/llpanelevent.cpp +++ b/indra/newview/llpanelevent.cpp @@ -154,9 +154,9 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **) F32 global_x = (F32)self->mEventInfo.mPosGlobal.mdV[VX]; F32 global_y = (F32)self->mEventInfo.mPosGlobal.mdV[VY]; - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)self->mEventInfo.mPosGlobal.mdV[VZ]); + S32 region_x = llmath::llround(global_x) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround(global_y) % REGION_WIDTH_UNITS; + S32 region_z = llmath::llround((F32)self->mEventInfo.mPosGlobal.mdV[VZ]); std::string desc = self->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z); self->mTBLocation->setText(desc); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 8a66eef09..18000914c 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -462,8 +462,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) land_type = LLTrans::getString("land_type_unknown"); } - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_x = llmath::llround(global_x) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround(global_y) % REGION_WIDTH_UNITS; std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y); std::string area; committed+=billable_area; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 71b507ef6..490e22399 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -270,7 +270,7 @@ LLInventoryView::~LLInventoryView( void ) llofstream filtersFile(filterSaveName.str()); if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile)) { - llwarns << "Could not write to filters save file " << filterSaveName << llendl; + llwarns << "Could not write to filters save file " << filterSaveName.str().c_str() << llendl; } else filtersFile.close(); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 1cf09178e..c93f41aa6 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -565,9 +565,9 @@ void LLPanelObject::getState( ) LLQuaternion object_rot = objectp->getRotationEdit(); object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ])); mCurEulerDegrees *= RAD_TO_DEG; - mCurEulerDegrees.mV[VX] = fmod(llround(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); - mCurEulerDegrees.mV[VY] = fmod(llround(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); - mCurEulerDegrees.mV[VZ] = fmod(llround(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VX] = fmod(llmath::llround(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VY] = fmod(llmath::llround(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); + mCurEulerDegrees.mV[VZ] = fmod(llmath::llround(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f); if (enable_rotate) { @@ -1965,9 +1965,9 @@ void LLPanelObject::sendRotation(BOOL btn_down) if (mObject.isNull()) return; LLVector3 new_rot(mCtrlRotX->get(), mCtrlRotY->get(), mCtrlRotZ->get()); - new_rot.mV[VX] = llround(new_rot.mV[VX], OBJECT_ROTATION_PRECISION); - new_rot.mV[VY] = llround(new_rot.mV[VY], OBJECT_ROTATION_PRECISION); - new_rot.mV[VZ] = llround(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION); + new_rot.mV[VX] = llmath::llround(new_rot.mV[VX], OBJECT_ROTATION_PRECISION); + new_rot.mV[VY] = llmath::llround(new_rot.mV[VY], OBJECT_ROTATION_PRECISION); + new_rot.mV[VZ] = llmath::llround(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION); // Note: must compare before conversion to radians LLVector3 delta = new_rot - mCurEulerDegrees; diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 674d9b65d..c2e2a2cb1 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -178,9 +178,9 @@ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type) self->mImporting = false; } - S32 region_x = llround((F32)pick_info->pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)pick_info->pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)pick_info->pos_global.mdV[VZ]); + S32 region_x = llmath::llround((F32)pick_info->pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround((F32)pick_info->pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llmath::llround((F32)pick_info->pos_global.mdV[VZ]); location_text.append(llformat("(%d, %d, %d)", region_x, region_y, region_z)); mDataReceived = true; @@ -401,9 +401,9 @@ void LLPanelPick::onClickSet() std::string location_text("(will update after save), " + mSimName); - S32 region_x = llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)mPosGlobal.mdV[VZ]); + S32 region_x = llmath::llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llmath::llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llmath::llround((F32)mPosGlobal.mdV[VZ]); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); // if sim name in pick is different from current sim name diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 80af2ac56..dfa5d88ef 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -289,16 +289,16 @@ void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data) } // Just use given region position for display - S32 region_x = llround(mPosRegion.mV[0]); - S32 region_y = llround(mPosRegion.mV[1]); - S32 region_z = llround(mPosRegion.mV[2]); + S32 region_x = llmath::llround(mPosRegion.mV[0]); + S32 region_y = llmath::llround(mPosRegion.mV[1]); + S32 region_z = llmath::llround(mPosRegion.mV[2]); // If the region position is zero, grab position from the global if(mPosRegion.isExactlyZero()) { - region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; - region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; - region_z = llround(parcel_data.global_z); + region_x = llmath::llround(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = llmath::llround(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = llmath::llround(parcel_data.global_z); } if(mPosGlobal.isExactlyZero()) diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 5fa463a34..91372b23c 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -642,12 +642,12 @@ void LLPanelPrimMediaControls::updateShape() // convert screenspace bbox to pixels (in screen coords) LLRect window_rect = gViewerWindow->getWorldViewRectScaled(); LLCoordGL screen_min; - screen_min.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.getF32ptr()[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.getF32ptr()[VY] + 1.f) * 0.5f); + screen_min.mX = llmath::llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.getF32ptr()[VX] + 1.f) * 0.5f); + screen_min.mY = llmath::llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.getF32ptr()[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.getF32ptr()[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.getF32ptr()[VY] + 1.f) * 0.5f); + screen_max.mX = llmath::llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.getF32ptr()[VX] + 1.f) * 0.5f); + screen_max.mY = llmath::llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.getF32ptr()[VY] + 1.f) * 0.5f); // grow panel so that screenspace bounding box fits inside "media_region" element of panel LLRect media_panel_rect; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 6d686b252..4127cfadc 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -590,7 +590,7 @@ void LLPreviewTexture::updateDimensions() client_width = getRect().getWidth() - horiz_pad; if (mAspectRatio > 0.f) { - client_height = llround(client_width / mAspectRatio); + client_height = llmath::llround(client_width / mAspectRatio); } else { @@ -608,7 +608,7 @@ void LLPreviewTexture::updateDimensions() if (client_height > max_height) { client_height = max_height; - client_width = llround(client_height * mAspectRatio); + client_width = llmath::llround(client_height * mAspectRatio); } } else diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index fdd812d65..5862dd958 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -356,9 +356,9 @@ LLSLURL::LLSLURL(const std::string& grid, { mGrid = grid; mRegion = region; - S32 x = llround( (F32)position[VX] ); - S32 y = llround( (F32)position[VY] ); - S32 z = llround( (F32)position[VZ] ); + S32 x = llmath::llround( (F32)position[VX] ); + S32 y = llmath::llround( (F32)position[VY] ); + S32 z = llmath::llround( (F32)position[VZ] ); mType = LOCATION; mPosition = LLVector3(x, y, z); } @@ -417,9 +417,9 @@ std::string LLSLURL::getSLURLString() const case LOCATION: { // lookup the grid - S32 x = llround( (F32)mPosition[VX] ); - S32 y = llround( (F32)mPosition[VY] ); - S32 z = llround( (F32)mPosition[VZ] ); + S32 x = llmath::llround( (F32)mPosition[VX] ); + S32 y = llmath::llround( (F32)mPosition[VY] ); + S32 z = llmath::llround( (F32)mPosition[VZ] ); //return LLGridManager::getInstance()->getSLURLBase(mGrid) + //Singu TODO: Implement LLHippoGridMgr::getSLURLBase some day. For now it's hardcoded. std::string fixed_slurl; @@ -471,9 +471,9 @@ std::string LLSLURL::getLoginString() const case LOCATION: unescaped_start << "uri:" << mRegion << "&" - << llround(mPosition[0]) << "&" - << llround(mPosition[1]) << "&" - << llround(mPosition[2]); + << llmath::llround(mPosition[0]) << "&" + << llmath::llround(mPosition[1]) << "&" + << llmath::llround(mPosition[2]); break; case HOME_LOCATION: unescaped_start << "home"; @@ -517,9 +517,9 @@ std::string LLSLURL::getLocationString() const { return llformat("%s/%d/%d/%d", mRegion.c_str(), - (int)llround(mPosition[0]), - (int)llround(mPosition[1]), - (int)llround(mPosition[2])); + (int)llmath::llround(mPosition[0]), + (int)llmath::llround(mPosition[1]), + (int)llmath::llround(mPosition[2])); } // static diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index dc1e19f1f..a6c8009ac 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1616,7 +1616,7 @@ bool idle_startup() if (gNoRender) { LL_WARNS("AppInit") << "Bad login - missing return values" << LL_ENDL; - LL_WARNS("AppInit") << emsg << LL_ENDL; + LL_WARNS("AppInit") << emsg.str() << LL_ENDL; exit(0); } // Bounce back to the login screen. @@ -1632,7 +1632,7 @@ bool idle_startup() if (gNoRender) { LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL; - LL_WARNS("AppInit") << emsg << LL_ENDL; + LL_WARNS("AppInit") << emsg.str() << LL_ENDL; exit(0); } // Bounce back to the login screen. diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index fd7c0da59..bdf34d6c6 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -1425,10 +1425,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; - x_begin = llround(x * scale_inv); - y_begin = llround(y * scale_inv); - x_end = llround((x + width) * scale_inv); - y_end = llround((y + width) * scale_inv); + x_begin = llmath::llround(x * scale_inv); + y_begin = llmath::llround(y * scale_inv); + x_end = llmath::llround((x + width) * scale_inv); + y_end = llmath::llround((y + width) * scale_inv); if (x_end > tex_width) { @@ -1476,9 +1476,9 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, // Want non-linear curve for transparency gradient coloru = MAX_WATER_COLOR; const F32 frac = 1.f - 2.f/(2.f - (height - WATER_HEIGHT)); - S32 alpha = 64 + llround((255-64)*frac); + S32 alpha = 64 + llmath::llround((255-64)*frac); - alpha = llmin(llround((F32)MAX_WATER_COLOR.mV[3]), alpha); + alpha = llmin(llmath::llround((F32)MAX_WATER_COLOR.mV[3]), alpha); alpha = llmax(64, alpha); coloru.mV[3] = alpha; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 7a0955c4f..fca81e83f 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1167,7 +1167,7 @@ LLTextureCtrl::LLTextureCtrl( S32 image_top = getRect().getHeight(); S32 image_bottom = BTN_HEIGHT_SMALL; S32 image_middle = (image_top + image_bottom) / 2; - S32 line_height = llround(LLFontGL::getFontSansSerifSmall()->getLineHeight()); + S32 line_height = llmath::llround(LLFontGL::getFontSansSerifSmall()->getLineHeight()); mTentativeLabel = new LLTextBox( std::string("Multiple"), LLRect( diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 0c6637828..9a09c3ed3 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -226,8 +226,8 @@ void LLToolSelectLand::handleDeselect() void LLToolSelectLand::roundXY(LLVector3d &vec) { - vec.mdV[VX] = llround( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - vec.mdV[VY] = llround( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + vec.mdV[VX] = llmath::llround( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + vec.mdV[VY] = llmath::llround( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 4994869ce..6fe2d4d9d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1254,8 +1254,8 @@ LLRect get_whole_screen_region() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); + S32 tile_width = llmath::llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); + S32 tile_height = llmath::llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); int tile_y = sub_region / num_horizontal_tiles; int tile_x = sub_region - (tile_y * num_horizontal_tiles); @@ -1539,8 +1539,8 @@ void render_ui_2d() int pos_y = sub_region / llceil(zoom_factor); int pos_x = sub_region - (pos_y*llceil(zoom_factor)); // offset for this tile - LLFontGL::sCurOrigin.mX -= llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); - LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); + LLFontGL::sCurOrigin.mX -= llmath::llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); + LLFontGL::sCurOrigin.mY -= llmath::llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); } stop_glerror(); diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 5104f7972..4bd4b4c42 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -65,7 +65,7 @@ void agent_jump( EKeystate s ) { if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = llmath::llround(gKeyboard->getCurKeyElapsedFrameCount()); if( time < FLY_TIME || frame_count <= FLY_FRAMES || gAgent.upGrabbed() @@ -141,7 +141,7 @@ static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDo if (KEYSTATE_UP == s) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = llmath::llround(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { @@ -169,7 +169,7 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT agent_handle_doubletap_run(s, mode); if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + S32 frame_count = llmath::llround(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2050c3983..5a876559f 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -940,7 +940,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg) { F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest()); - pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension)); + pimpl->setLowPrioritySizeLimit(llmath::llround(approximate_interest_dimension)); } } else @@ -2366,8 +2366,8 @@ void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32 texture_y = 1.0 + texture_y; // scale x and y to texel units. - *x = llround(texture_x * plugin->getTextureWidth()); - *y = llround((1.0f - texture_y) * plugin->getTextureHeight()); + *x = llmath::llround(texture_x * plugin->getTextureWidth()); + *y = llmath::llround((1.0f - texture_y) * plugin->getTextureHeight()); // Adjust for the difference between the actual texture height and the amount of the texture in use. *y -= (plugin->getTextureHeight() - plugin->getHeight()); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1c5ed208f..cdac1f226 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3958,9 +3958,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { // Compute the object SLURL. LLVector3 pos = chatter->getPositionRegion(); - S32 x = llround((F32)fmod((F64)pos.mV[VX], (F64)REGION_WIDTH_METERS)); - S32 y = llround((F32)fmod((F64)pos.mV[VY], (F64)REGION_WIDTH_METERS)); - S32 z = llround((F32)pos.mV[VZ]); + S32 x = llmath::llround((F32)fmod((F64)pos.mV[VX], (F64)REGION_WIDTH_METERS)); + S32 y = llmath::llround((F32)fmod((F64)pos.mV[VY], (F64)REGION_WIDTH_METERS)); + S32 z = llmath::llround((F32)pos.mV[VZ]); std::ostringstream location; location << chatter->getRegion()->getName() << "/" << x << "/" << y << "/" << z; query_string["slurl"] = location.str(); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 977d8fede..63ba67994 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -315,7 +315,7 @@ S32 LLViewerParcelMgr::getSelectedArea() const F64 width = mEastNorth.mdV[VX] - mWestSouth.mdV[VX]; F64 height = mEastNorth.mdV[VY] - mWestSouth.mdV[VY]; F32 area = (F32)(width * height); - rv = llround(area); + rv = llmath::llround(area); } return rv; } @@ -335,10 +335,10 @@ void LLViewerParcelMgr::writeHighlightSegments(F32 west, F32 south, F32 east, F32 north) { S32 x, y; - S32 min_x = llround( west / PARCEL_GRID_STEP_METERS ); - S32 max_x = llround( east / PARCEL_GRID_STEP_METERS ); - S32 min_y = llround( south / PARCEL_GRID_STEP_METERS ); - S32 max_y = llround( north / PARCEL_GRID_STEP_METERS ); + S32 min_x = llmath::llround( west / PARCEL_GRID_STEP_METERS ); + S32 max_x = llmath::llround( east / PARCEL_GRID_STEP_METERS ); + S32 min_y = llmath::llround( south / PARCEL_GRID_STEP_METERS ); + S32 max_y = llmath::llround( north / PARCEL_GRID_STEP_METERS ); const S32 STRIDE = mParcelsPerEdge+1; @@ -450,12 +450,12 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_ LLVector3d northeast = pos_global; southwest -= LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 ); - southwest.mdV[VX] = llround( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - southwest.mdV[VY] = llround( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + southwest.mdV[VX] = llmath::llround( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + southwest.mdV[VY] = llmath::llround( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); northeast += LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 ); - northeast.mdV[VX] = llround( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); - northeast.mdV[VY] = llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); + northeast.mdV[VX] = llmath::llround( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS ); + northeast.mdV[VY] = llmath::llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS ); // Snap to parcel return selectLand( southwest, northeast, TRUE ); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 3c0c37b3e..5e334e634 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -397,7 +397,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } // Do glow interpolation - part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + part->mGlow.mV[3] = (U8) llmath::llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); // Set the last update time to now. part->mLastUpdateTime = cur_time; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index cbd0cc31e..10b70f398 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -322,7 +322,7 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mStartGlow = mPartSysData.mPartData.mStartGlow; part->mEndGlow = mPartSysData.mPartData.mEndGlow; - part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f)); + part->mGlow = LLColor4U(0, 0, 0, (U8) llmath::llround(part->mStartGlow*255.f)); if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 1e6b7a343..fc5d30890 100644 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -174,7 +174,7 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, if (!(mMode & SMOOTH)) { - frame_counter = (F32)llround(frame_counter); + frame_counter = (F32)llmath::llround(frame_counter); } // diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 099927c6d..8663e82b7 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -846,8 +846,8 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK BOOL handled = FALSE; S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = llmath::llround((F32)x / mDisplayScale.mV[VX]); + y = llmath::llround((F32)y / mDisplayScale.mV[VY]); if (down) { @@ -1021,8 +1021,8 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK { S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = llmath::llround((F32)x / mDisplayScale.mV[VX]); + y = llmath::llround((F32)y / mDisplayScale.mV[VY]); LLView::sMouseHandlerMessage.clear(); @@ -1220,8 +1220,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask S32 x = pos.mX; S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); + x = llmath::llround((F32)x / mDisplayScale.mV[VX]); + y = llmath::llround((F32)y / mDisplayScale.mV[VY]); mMouseInWindow = TRUE; @@ -1709,7 +1709,7 @@ LLViewerWindow::LLViewerWindow( LLCoordWindow size; mWindow->getSize(&size); mWindowRectRaw.set(0, size.mY, size.mX, 0); - mWindowRectScaled.set(0, llround((F32)size.mY / mDisplayScale.mV[VY]), llround((F32)size.mX / mDisplayScale.mV[VX]), 0); + mWindowRectScaled.set(0, llmath::llround((F32)size.mY / mDisplayScale.mV[VY]), llmath::llround((F32)size.mX / mDisplayScale.mV[VX]), 0); } LLFontManager::initClass(); @@ -2391,8 +2391,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) LLUI::setScaleFactor(mDisplayScale); // update our window rectangle - mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llround((F32)width / mDisplayScale.mV[VX]); - mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llround((F32)height / mDisplayScale.mV[VY]); + mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llmath::llround((F32)width / mDisplayScale.mV[VX]); + mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llmath::llround((F32)height / mDisplayScale.mV[VY]); setup2DViewport(); @@ -2552,8 +2552,8 @@ void LLViewerWindow::draw() microsecondsToTimecodeString(gFrameTime,text); const LLFontGL* font = LLFontGL::getFontSansSerif(); font->renderUTF8(text, 0, - llround((getWindowWidthScaled()/2)-100.f), - llround((getWindowHeightScaled()-60.f)), + llmath::llround((getWindowWidthScaled()/2)-100.f), + llmath::llround((getWindowHeightScaled()-60.f)), LLColor4( 1.f, 1.f, 1.f, 1.f ), LLFontGL::LEFT, LLFontGL::TOP); } @@ -2653,7 +2653,7 @@ void LLViewerWindow::draw() const S32 DIST_FROM_TOP = 20; LLFontGL::getFontSansSerifBig()->renderUTF8( mOverlayTitle, 0, - llround( getWindowWidthScaled() * 0.5f), + llmath::llround( getWindowWidthScaled() * 0.5f), getWindowHeightScaled() - DIST_FROM_TOP, LLColor4(1, 1, 1, 0.4f), LLFontGL::HCENTER, LLFontGL::TOP); @@ -3505,7 +3505,7 @@ void LLViewerWindow::updateMouseDelta() fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f); fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f); - mCurrentMouseDelta.set(llround(fdx), llround(fdy)); + mCurrentMouseDelta.set(llmath::llround(fdx), llmath::llround(fdy)); mouse_vel.setVec(fdx,fdy); } else @@ -4788,10 +4788,10 @@ bool LLViewerWindow::rawRawSnapshot(LLImageRaw *raw, // However, if the buffer turns out to be too large, then clamp it to max_size. scale_factor = llmin(max_size / snapshot_width, max_size / snapshot_height)) // Clamp { - image_buffer_x = llround(unscaled_image_buffer_x * scale_factor); - image_buffer_y = llround(unscaled_image_buffer_y * scale_factor); - S32 image_size_x = llround(snapshot_width * scale_factor); - S32 image_size_y = llround(snapshot_width * scale_factor); + image_buffer_x = llmath::llround(unscaled_image_buffer_x * scale_factor); + image_buffer_y = llmath::llround(unscaled_image_buffer_y * scale_factor); + S32 image_size_x = llmath::llround(snapshot_width * scale_factor); + S32 image_size_y = llmath::llround(snapshot_width * scale_factor); if (llmax(image_size_x, image_size_y) > max_size && // Boundary check to avoid memory overflow. internal_scale <= 1.f && !reset_deferred) // SHY_MOD: If supersampling... Don't care about max_size. { @@ -5058,7 +5058,7 @@ void LLViewerWindow::drawMouselookInstructions() INSTRUCTIONS_PAD, getWindowHeight() - INSTRUCTIONS_PAD, font->getWidth( instructions ) + 2 * INSTRUCTIONS_PAD, - llround(font->getLineHeight() + 2 * INSTRUCTIONS_PAD)); + llmath::llround(font->getLineHeight() + 2 * INSTRUCTIONS_PAD)); { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -5668,8 +5668,8 @@ void LLViewerWindow::calcDisplayScale() if (mWindow->getFullscreen()) { - display_scale.mV[0] = llround(display_scale.mV[0], 2.0f/(F32) mWindowRectRaw.getWidth()); - display_scale.mV[1] = llround(display_scale.mV[1], 2.0f/(F32) mWindowRectRaw.getHeight()); + display_scale.mV[0] = llmath::llround(display_scale.mV[0], 2.0f/(F32) mWindowRectRaw.getWidth()); + display_scale.mV[1] = llmath::llround(display_scale.mV[1], 2.0f/(F32) mWindowRectRaw.getHeight()); } if (display_scale != mDisplayScale) @@ -5953,8 +5953,8 @@ void LLPickInfo::updateXYCoords() LLPointer imagep = LLViewerTextureManager::getFetchedTexture(tep->getID()); if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull()) { - mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth()); - mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight()); + mXYCoords.mX = llmath::llround(mUVCoords.mV[VX] * (F32)imagep->getWidth()); + mXYCoords.mY = llmath::llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight()); } } } @@ -5983,7 +5983,7 @@ void LLPickInfo::getSurfaceInfo() if (objectp) { - if (gViewerWindow->cursorIntersect(llround((F32)mMousePt.mX), llround((F32)mMousePt.mY), 1024.f, + if (gViewerWindow->cursorIntersect(llmath::llround((F32)mMousePt.mX), llmath::llround((F32)mMousePt.mY), 1024.f, objectp, -1, mPickTransparent, &mObjectFace, &intersection, @@ -6041,8 +6041,8 @@ LLVector2 LLPickInfo::pickUV() objectp->mDrawable.notNull() && objectp->getPCode() == LL_PCODE_VOLUME && mObjectFace < objectp->mDrawable->getNumFaces()) { - S32 scaled_x = llround((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]); - S32 scaled_y = llround((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]); + S32 scaled_x = llmath::llround((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]); + S32 scaled_y = llmath::llround((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]); const S32 UV_PICK_WIDTH = 5; const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2; U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4]; diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 94ae918be..a15fb9872 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -133,10 +133,10 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; - x_begin = llround( x * mScaleInv ); - y_begin = llround( y * mScaleInv ); - x_end = llround( (x + width) * mScaleInv ); - y_end = llround( (y + width) * mScaleInv ); + x_begin = llmath::llround( x * mScaleInv ); + y_begin = llmath::llround( y * mScaleInv ); + x_end = llmath::llround( (x + width) * mScaleInv ); + y_end = llmath::llround( (y + width) * mScaleInv ); if (x_end > mWidth) { @@ -331,8 +331,8 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, S32 x_begin, y_begin, x_end, y_end; x_begin = (S32)(x * mScaleInv); y_begin = (S32)(y * mScaleInv); - x_end = llround( (x + width) * mScaleInv ); - y_end = llround( (y + width) * mScaleInv ); + x_end = llmath::llround( (x + width) * mScaleInv ); + y_end = llmath::llround( (y + width) * mScaleInv ); if (x_end > mWidth) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 802105235..2e5e1d7e9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7995,7 +7995,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe if (it != contents.mParams.end()) { S32 index = it - contents.mParams.begin(); - contents.mParamAppearanceVersion = llround(contents.mParamWeights[index]); + contents.mParamAppearanceVersion = llmath::llround(contents.mParamWeights[index]); LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL; } } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 46edb4fa7..fadf0ee51 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -2597,7 +2597,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) if(!p->mIsSelf) { // scale from the range 0.0-1.0 to vivox volume in the range 0-100 - S32 volume = llround(p->mVolume / VOLUME_SCALE_VIVOX); + S32 volume = llmath::llround(p->mVolume / VOLUME_SCALE_VIVOX); bool mute = p->mOnMuteList; if(mute) diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 7b4077798..837d0aea2 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -699,7 +699,7 @@ void LLVOPartGroup::getGeometry(S32 idx, } else { - pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow)); + pglow = LLColor4U(0, 0, 0, (U8) llmath::llround(255.f*part.mStartGlow)); pcolor = part.mStartColor; } } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7010d8c7f..d754b5426 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1210,7 +1210,7 @@ S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) { // We've got LOD in the profile, and in the twist. Use radius. F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance; - cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f)); + cur_detail = LLVolumeLODGroup::getDetailFromTan(llmath::llround(tan_angle, 0.01f)); } else { @@ -1257,8 +1257,8 @@ BOOL LLVOVolume::calcLOD() // DON'T Compensate for field of view changing on FOV zoom. distance *= F_PI/3.f; - cur_detail = computeLODDetail(llround(distance, 0.01f), - llround(radius, 0.01f)); + cur_detail = computeLODDetail(llmath::llround(distance, 0.01f), + llmath::llround(radius, 0.01f)); if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && @@ -1271,7 +1271,7 @@ BOOL LLVOVolume::calcLOD() if (cur_detail != mLOD) { - mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); + mAppAngle = llmath::llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); mLOD = cur_detail; return TRUE; } @@ -4903,7 +4903,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } /*LLColor4 clr = facep->getFaceColor(); - LLColor4U clru = LLColor4U(llround(clr.mV[0] * 255.f), llround(clr.mV[0] * 255.f), llround(clr.mV[0] * 255.f), llround(clr.mV[0] * 255.f)); + LLColor4U clru = LLColor4U(llmath::llround(clr.mV[0] * 255.f), llmath::llround(clr.mV[0] * 255.f), llmath::llround(clr.mV[0] * 255.f), llmath::llround(clr.mV[0] * 255.f)); if(clru.mV[0] == 164 && clru.mV[1] == 106 && clr.mV[2] == 65) { llinfos << "Facepool = " << type << " alpha = " << clr.mV[3] << llendl; diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp index 953898fe6..3bdc1ae5e 100644 --- a/indra/newview/llwlanimator.cpp +++ b/indra/newview/llwlanimator.cpp @@ -267,7 +267,7 @@ std::string LLWLAnimator::timeToString(F32 curTime) // get hours and minutes hours = (S32) (24.0 * curTime); curTime -= ((F32) hours / 24.0f); - min = llround(24.0f * 60.0f * curTime); + min = llmath::llround(24.0f * 60.0f * curTime); // handle case where it's 60 if(min == 60) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 8e1b1e4be..ee1a52b9f 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1122,7 +1122,7 @@ void LLWorld::updateWaterObjects() // Count the found coastline. F32 new_water_height = water_heights[index]; LL_DEBUGS("WaterHeight") << " This is void; counting coastline with water height of " << new_water_height << LL_ENDL; - S32 new_water_height_cm = llround(new_water_height * 100); + S32 new_water_height_cm = llmath::llround(new_water_height * 100); int count = (water_height_counts[new_water_height_cm] += 1); // Just use the lowest water height: this is mainly about the horizon water, // and whatever we do, we don't want it to be possible to look under the water diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 2d76879e2..3742ba4df 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -467,9 +467,9 @@ void LLWorldMapView::draw() if (overlayimage) { // Inform the fetch mechanism of the size we need - S32 draw_size = llround(sMapScale); - overlayimage->setKnownDrawSize( llround(draw_size * LLUI::getScaleFactor().mV[VX] * ((F32)info->getSizeX() / REGION_WIDTH_METERS)), - llround(draw_size * LLUI::getScaleFactor().mV[VY] * ((F32)info->getSizeY() / REGION_WIDTH_METERS))); + S32 draw_size = llmath::llround(sMapScale); + overlayimage->setKnownDrawSize( llmath::llround(draw_size * LLUI::getScaleFactor().mV[VX] * ((F32)info->getSizeX() / REGION_WIDTH_METERS)), + llmath::llround(draw_size * LLUI::getScaleFactor().mV[VY] * ((F32)info->getSizeY() / REGION_WIDTH_METERS))); // Draw something whenever we have enough info if (overlayimage->hasGLTexture() && !overlayimage->isMissingAsset() && overlayimage->getID() != IMG_DEFAULT) { @@ -674,14 +674,14 @@ void LLWorldMapView::draw() drawImage(pos_global, sAvatarYouImage); LLVector3 pos_map = globalPosToView(pos_global); - if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) + if (!pointInView(llmath::llround(pos_map.mV[VX]), llmath::llround(pos_map.mV[VY]))) { drawTracking(pos_global, lerp(LLColor4::yellow, LLColor4::orange, 0.4f), TRUE, "You are here", "", - llround(LLFontGL::getFontSansSerifSmall()->getLineHeight())); // offset vertically by one line, to avoid overlap with target tracking + llmath::llround(LLFontGL::getFontSansSerifSmall()->getLineHeight())); // offset vertically by one line, to avoid overlap with target tracking } // Show your viewing angle @@ -823,8 +823,8 @@ void LLWorldMapView::drawLegacyBackgroundLayers(S32 width, S32 height) { } current_image->setBoostLevel(LLGLTexture::BOOST_MAP); - current_image->setKnownDrawSize(llround(pix_width * LLUI::getScaleFactor().mV[VX]), - llround(pix_height * LLUI::getScaleFactor().mV[VY])); + current_image->setKnownDrawSize(llmath::llround(pix_width * LLUI::getScaleFactor().mV[VX]), + llmath::llround(pix_height * LLUI::getScaleFactor().mV[VY])); if (!current_image->hasGLTexture()) //Still loading. { @@ -911,9 +911,9 @@ F32 LLWorldMapView::drawLegacySimTile(LLSimInfo& sim_info, S32 left, S32 top, S3 //call setKnownDrawSize if image is still loading, or its actually being drawn. if(sim_fetching || alpha >= ALPHA_CUTOFF) { - S32 draw_size = llround(sMapScale); - simimage->setKnownDrawSize( llround(draw_size * LLUI::getScaleFactor().mV[VX] * ((F32)sim_info.getSizeX() / REGION_WIDTH_METERS)), - llround(draw_size * LLUI::getScaleFactor().mV[VY] * ((F32)sim_info.getSizeY() / REGION_WIDTH_METERS))); + S32 draw_size = llmath::llround(sMapScale); + simimage->setKnownDrawSize( llmath::llround(draw_size * LLUI::getScaleFactor().mV[VX] * ((F32)sim_info.getSizeX() / REGION_WIDTH_METERS)), + llmath::llround(draw_size * LLUI::getScaleFactor().mV[VY] * ((F32)sim_info.getSizeY() / REGION_WIDTH_METERS))); simimage->setBoostLevel(LLGLTexture::BOOST_MAP); if(alpha >= ALPHA_CUTOFF) { @@ -1128,8 +1128,8 @@ void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLUIImagePtr image) void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color) { LLVector3 pos_map = globalPosToView( global_pos ); - image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f), + image->draw(llmath::llround(pos_map.mV[VX] - image->getWidth() /2.f), + llmath::llround(pos_map.mV[VY] - image->getHeight()/2.f), color); } @@ -1138,8 +1138,8 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i LLVector3 pos_map = globalPosToView( global_pos ); for(U32 i=0; idraw(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), + image->draw(llmath::llround(pos_map.mV[VX] - image->getWidth() /2.f), + llmath::llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), color); } } @@ -1323,8 +1323,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& const std::string& label, const std::string& tooltip, S32 vert_offset ) { LLVector3 pos_local = globalPosToView( pos_global ); - S32 x = llround( pos_local.mV[VX] ); - S32 y = llround( pos_local.mV[VY] ); + S32 x = llmath::llround( pos_local.mV[VX] ); + S32 y = llmath::llround( pos_local.mV[VY] ); LLFontGL* font = LLFontGL::getFontSansSerifSmall(); S32 text_x = x; S32 text_y = (S32)(y - sTrackCircleImage->getHeight()/2 - font->getLineHeight()); @@ -1356,7 +1356,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& const S32 TEXT_PADDING = DEFAULT_TRACKING_ARROW_SIZE + 2; S32 half_text_width = llfloor(font->getWidthF32(label) * 0.5f); text_x = llclamp(text_x, half_text_width + TEXT_PADDING, getRect().getWidth() - half_text_width - TEXT_PADDING); - text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - llround(font->getLineHeight()) - TEXT_PADDING - vert_offset); + text_y = llclamp(text_y + vert_offset, TEXT_PADDING + vert_offset, getRect().getHeight() - llmath::llround(font->getLineHeight()) - TEXT_PADDING - vert_offset); //if (label != "") // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.4.5) | Added: RLVa-1.0.0 @@ -1484,8 +1484,8 @@ static void drawDot(F32 x_pixels, F32 y_pixels, if(-HEIGHT_THRESHOLD <= relative_z && relative_z <= HEIGHT_THRESHOLD) { - dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2, - llround(y_pixels) - dot_image->getHeight()/2, + dot_image->draw(llmath::llround(x_pixels) - dot_image->getWidth()/2, + llmath::llround(y_pixels) - dot_image->getHeight()/2, color); } else @@ -1540,9 +1540,9 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, dot_image = sAvatarAboveImage; } - S32 dot_width = llround(dot_radius * 2.f); - dot_image->draw(llround(x_pixels - dot_radius), - llround(y_pixels - dot_radius), + S32 dot_width = llmath::llround(dot_radius * 2.f); + dot_image->draw(llmath::llround(x_pixels - dot_radius), + llmath::llround(y_pixels - dot_radius), dot_width, dot_width, color); @@ -1569,8 +1569,8 @@ void LLWorldMapView::drawIconName(F32 x_pixels, const std::string& second_line) { const S32 VERT_PAD = 8; - S32 text_x = llround(x_pixels); - S32 text_y = llround(y_pixels + S32 text_x = llmath::llround(x_pixels); + S32 text_y = llmath::llround(y_pixels - BIG_DOT_RADIUS - VERT_PAD); @@ -1584,7 +1584,7 @@ void LLWorldMapView::drawIconName(F32 x_pixels, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW); - text_y -= llround(LLFontGL::getFontSansSerif()->getLineHeight()); + text_y -= llmath::llround(LLFontGL::getFontSansSerif()->getLineHeight()); // render text LLFontGL::getFontSansSerif()->renderUTF8(second_line, 0, @@ -1758,8 +1758,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation ) F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); text_box->setOrigin( - llround(map_half_width - text_half_width + radius * cos( rotation )), - llround(map_half_height - text_half_height + radius * sin( rotation )) ); + llmath::llround(map_half_width - text_half_width + radius * cos( rotation )), + llmath::llround(map_half_height - text_half_height + radius * sin( rotation )) ); } @@ -1807,8 +1807,8 @@ void LLWorldMapView::reshape( S32 width, S32 height, BOOL called_from_parent ) bool LLWorldMapView::checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track) { LLVector3 pos_view = globalPosToView(item.getGlobalPosition()); - S32 item_x = llround(pos_view.mV[VX]); - S32 item_y = llround(pos_view.mV[VY]); + S32 item_x = llmath::llround(pos_view.mV[VX]); + S32 item_y = llmath::llround(pos_view.mV[VY]); if (x < item_x - BIG_DOT_RADIUS) return false; if (x > item_x + BIG_DOT_RADIUS) return false; @@ -1983,8 +1983,8 @@ BOOL LLWorldMapView::handleMouseDown( S32 x, S32 y, MASK mask ) { gFocusMgr.setMouseCapture( this ); - mMouseDownPanX = llround(sPanX); - mMouseDownPanY = llround(sPanY); + mMouseDownPanX = llmath::llround(sPanX); + mMouseDownPanY = llmath::llround(sPanY); mMouseDownX = x; mMouseDownY = y; sHandledLastClick = TRUE; diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 51d47563e..aa0529bb1 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -211,8 +211,11 @@ class WindowsManifest(ViewerManifest): self.end_prefix() # For mesh upload - if self.prefix(src=self.args['configuration'], dst=""): + if not self.is_win64() and self.prefix(src=self.args['configuration'], dst=""): self.path("libcollada14dom22.dll") + self.end_prefix() + + if self.prefix(src=self.args['configuration'], dst=""): self.path("glod.dll") self.end_prefix() diff --git a/indra/tools/vstool/VSTool.csproj b/indra/tools/vstool/VSTool.csproj index 5d8764b6b..6cd1890fe 100644 --- a/indra/tools/vstool/VSTool.csproj +++ b/indra/tools/vstool/VSTool.csproj @@ -1,4 +1,5 @@ - + + Local 8.0.50727 @@ -25,6 +26,8 @@ + v2.0 + 2.0 .\ diff --git a/indra/tools/vstool/VSTool.exe b/indra/tools/vstool/VSTool.exe index 7ded46ecd..1f0b88beb 100755 Binary files a/indra/tools/vstool/VSTool.exe and b/indra/tools/vstool/VSTool.exe differ diff --git a/indra/tools/vstool/VSTool.sln b/indra/tools/vstool/VSTool.sln index 543a0a2ef..4d83fac34 100644 --- a/indra/tools/vstool/VSTool.sln +++ b/indra/tools/vstool/VSTool.sln @@ -1,5 +1,7 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSTool", "VSTool.csproj", "{96943E2D-1373-4617-A117-D0F997A94919}" EndProject Global diff --git a/indra/tools/vstool/main.cs b/indra/tools/vstool/main.cs index ddf37e85c..be33ae98b 100644 --- a/indra/tools/vstool/main.cs +++ b/indra/tools/vstool/main.cs @@ -556,7 +556,7 @@ namespace VSTool break; case "12.00": - version = "VC110"; + version = "VC120"; break; default: throw new ApplicationException("Unknown .sln version: " + format); @@ -601,6 +601,11 @@ namespace VSTool case "VC110": progid = "VisualStudio.DTE.11.0"; break; + + case "VC120": + progid = "VisualStudio.DTE.12.0"; + break; + default: throw new ApplicationException("Can't handle VS version: " + version); } diff --git a/install.xml b/install.xml index a703de3fc..e3cbe4f88 100644 --- a/install.xml +++ b/install.xml @@ -67,9 +67,9 @@ windows64 md5sum - c6d96cc9f6d993e2147710a5fb0b089a + 54684a0e539879c4e20839929faca547 url - https://bitbucket.org/SingularityViewer/libraries/downloads/glod-1.0pre4-windows64-20131028.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/glod-1.0pre4-windows64-vs12-20140723.tar.bz2 @@ -136,9 +136,9 @@ windows64 md5sum - 7dcae03cad9bc04ac7e937284e6d102e + 1a3dbaf92136ca05e57c92c9c09cbff8 url - https://bitbucket.org/SingularityViewer/libraries/downloads/apr_suite-1.4.5-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/apr_suite-1.4.5-windows64-vs12-20140710.tar.bz2 @@ -183,9 +183,9 @@ windows64 md5sum - 2ca54250b59170f3e5342dacad529859 + b65ca4ce2e9cc34f3ac545ba3bfbdb3a url - https://bitbucket.org/SingularityViewer/libraries/downloads/ares-1.9.1-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/ares-1.10.0-windows64-vs12-20140709.tar.bz2 @@ -230,9 +230,9 @@ windows64 md5sum - 68c056e920ba2b25c0acded6f482a2e4 + 2b33deae4df210c8bb9e1aea6174bc13 url - https://bitbucket.org/SingularityViewer/libraries/downloads/boost-1.53.0-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/boost-1.56.0-windows64-vs12-20140816.tar.bz2 @@ -277,9 +277,9 @@ windows64 md5sum - acbe863e1b3df636e1245cc27c280e7b + 53b5cd120718119b8a31b5073a49360e url - https://bitbucket.org/SingularityViewer/libraries/downloads/colladadom-2.2-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/colladadom-2.3-windows64-vs12-20140816.tar.bz2 @@ -324,9 +324,9 @@ windows64 md5sum - ffb31d596f41b650bed49ac13bb513de + 3820517a958655c31890eaf71bb284ba url - https://bitbucket.org/SingularityViewer/libraries/downloads/curl-7.24.0-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/curl-7.37.1-windows64-vs12-20140722.tar.bz2 @@ -445,9 +445,9 @@ windows64 md5sum - 3239d5c50d6f2c857cc1a95674dbd1f5 + b68a9abb802abf52f63c805a589eb3fc url - https://bitbucket.org/SingularityViewer/libraries/downloads/expat-2.1.0-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/expat-2.1.0-windows64-vs12-20140709.tar.bz2 @@ -514,9 +514,9 @@ windows64 md5sum - bfde86bbd84536448ac2a717ed1646d8 + 4a33389ffa875bfd4554fa4d8198692c url - https://bitbucket.org/SingularityViewer/libraries/downloads/freetype-2.5.0.1-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/freetype-2.5.3-windows64-vs12-20140725.tar.bz2 @@ -607,9 +607,9 @@ windows64 md5sum - eeec9982df843043a18748276bbf39ce + 919c3fdfac84aaa69c84f1ce793cd9ff url - https://bitbucket.org/SingularityViewer/libraries/downloads/glui-2.36-windows-20110214.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/glui-2.36-windows64-vs12-20140710.tar.bz2 @@ -650,9 +650,9 @@ windows64 md5sum - f9072dda75012868d023c335ea5bcf88 + 61f46d94a137f8a50bc6328ed8a69762 url - https://bitbucket.org/SingularityViewer/libraries/downloads/google_breakpad-0.0.0-rev1099-windows64-20140606.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/google_breakpad-1351-windows64-vs12-20140723.tar.bz2 @@ -771,9 +771,9 @@ windows64 md5sum - 22fd1388454117626c2477509d3e93be + b97500817a949b250820ca300014d2c6 url - https://bitbucket.org/SingularityViewer/libraries/downloads/libhunspell-1.3.2-windows64-20140605.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/libhunspell-1.3.2-windows64-vs12-20140709.tar.bz2 @@ -818,9 +818,9 @@ windows64 md5sum - 79e328b10fae2090262c0bf02c9c5f71 + d687c074b621715499bfe6e9ba1acbd2 url - https://bitbucket.org/SingularityViewer/libraries/downloads/jpeglib-8c-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/libjpeg_turbo-1.3.1-windows64-vs12-20140709.tar.bz2 @@ -865,9 +865,9 @@ windows64 md5sum - 8cf95eef2a95b71eb4a8ab59779bed52 + a6de6a8188a87ce8048847f37b4ecd8f url - https://bitbucket.org/SingularityViewer/libraries/downloads/jsoncpp-0.5.0-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/jsoncpp-0.5.0-windows64-vs12-20140709.tar.bz2 @@ -912,9 +912,9 @@ windows64 md5sum - 00fc7bcb4016ecc57def9e3b3223d977 + 82ac61f5d208b0c907217fc90bb835dd url - https://bitbucket.org/SingularityViewer/libraries/downloads/libpng-1.5.10-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/libpng-1.6.8-windows64-vs12-20140709.tar.bz2 @@ -964,6 +964,13 @@ url https://bitbucket.org/SingularityViewer/libraries/downloads/libxml2-2.7.8-linux-x86_64-20120420.tar.bz2 + windows64 + + md5sum + 1c2effa8c26de72f6c92f65f83dd9e29 + url + https://bitbucket.org/SingularityViewer/libraries/downloads/libxml2-2.9.1-windows64-vs12-20140709.tar.bz2 + llqtwebkit @@ -1003,9 +1010,9 @@ windows64 md5sum - cf9e5d1d79531a7e4d45f78657da9c9b + a1c9564dbce8f3b0a296f9924e68a221 url - https://bitbucket.org/SingularityViewer/libraries/downloads/llqtwebkit-4.7.1-windows64-20131021.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/llqtwebkit-4.8.6-windows64-vs12-20140710.tar.bz2 @@ -1102,9 +1109,9 @@ windows64 md5sum - b59b4ddab26d4441829f50b48925baf0 + c0fd9371a94cd230c6076c80c7d83a1a url - https://bitbucket.org/SingularityViewer/libraries/downloads/libndofdev-0.1-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/libndofdev-0.1-windows64-vs12-20140710.tar.bz2 @@ -1149,9 +1156,9 @@ windows64 md5sum - a8ca0eef3d74936d504dab52ecc61ced + d074bd556211fd29c58326b2898b0a12 url - https://bitbucket.org/SingularityViewer/libraries/downloads/ogg_vorbis-1.2.2-1.3.2-windows64-20131020.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/ogg_vorbis-1.3.2-1.3.4-windows64-vs12-20140709.tar.bz2 @@ -1192,9 +1199,9 @@ windows64 md5sum - b50166f0b0a275c8ea0d3b11c578d792 + 66eba34f543bdd90e0656a9c97c8afae url - https://bitbucket.org/SingularityViewer/libraries/downloads/openssl-1.0.0g-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/openssl-1.0.1h-windows64-vs12-20140709.tar.bz2 @@ -1232,9 +1239,9 @@ windows64 md5sum - e75f1529adcaa6e508d1725f59d93a16 + 62f9844903ae76d2ae90d17ca5814060 url - https://bitbucket.org/SingularityViewer/libraries/downloads/openal-1.12.854-1.1.0-windows-20110301.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/openal-1.15.1-1.1.0-windows64-vs12-20140813.tar.bz2 @@ -1269,6 +1276,13 @@ url https://bitbucket.org/SingularityViewer/libraries/downloads/pcre-7.6-linux64-20130216.tar.bz2 + windows64 + + md5sum + ffdbc30ce4b9238070917073b6066b36 + url + https://bitbucket.org/SingularityViewer/libraries/downloads/pcre-8.35-windows64-vs12-20140816.tar.bz2 + pulseaudio @@ -1402,9 +1416,9 @@ windows64 md5sum - 94c26b93b855f5816bb29f308d9997fb + 56175d424e533bbc111a32054fbd2926 url - https://bitbucket.org/SingularityViewer/libraries/downloads/xmlrpc_epi-0.54.1-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/xmlrpc_epi-0.54.1-windows64-vs12-20140709.tar.bz2 @@ -1449,9 +1463,9 @@ windows64 md5sum - 5aa50bd41d6cf0262a94760ef66bdbcf + 3f1ca95ca4461aac57e7255c42db3ebc url - https://bitbucket.org/SingularityViewer/libraries/downloads/zlib-1.2.8-windows64-20131019.tar.bz2 + https://bitbucket.org/SingularityViewer/libraries/downloads/zlib-1.2.8-windows64-vs12-20140709.tar.bz2