Merge branch 'develop' of https://github.com/secondlife/viewer
# Conflicts: # indra/llcommon/llpointer.h # indra/llcommon/llqueuedthread.cpp # indra/llfilesystem/llfilesystem.cpp # indra/llui/llconsole.cpp # indra/llui/llkeywords.cpp # indra/llui/llstatgraph.cpp # indra/llui/llvirtualtrackball.cpp # indra/newview/llagentcamera.cpp # indra/newview/llappviewer.cpp # indra/newview/llfloateremojipicker.cpp # indra/newview/llfloaterimnearbychathandler.cpp # indra/newview/llfloatersettingsdebug.cpp # indra/newview/llfloatersnapshot.cpp # indra/newview/llglsandbox.cpp # indra/newview/llnetmap.cpp # indra/newview/llpanelface.cpp # indra/newview/llpanelpermissions.cpp # indra/newview/llpanelplaceprofile.cpp # indra/newview/llstartup.cpp # indra/newview/llviewermessage.cpp # indra/newview/llvocache.cpp # indra/newview/llworldmapview.cppmaster
commit
088cc2ea35
|
|
@ -559,7 +559,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
|||
}
|
||||
if (mLastWeight != mLastWeight)
|
||||
{
|
||||
mLastWeight = mCurWeight+.001;
|
||||
mLastWeight = mCurWeight+.001f;
|
||||
}
|
||||
|
||||
// perform differential update of morph
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ void LLTexLayerSetBuffer::pushProjection() const
|
|||
gGL.matrixMode(LLRender::MM_PROJECTION);
|
||||
gGL.pushMatrix();
|
||||
gGL.loadIdentity();
|
||||
gGL.ortho(0.0f, getCompositeWidth(), 0.0f, getCompositeHeight(), -1.0f, 1.0f);
|
||||
gGL.ortho(0.0f, (F32)getCompositeWidth(), 0.0f, (F32)getCompositeHeight(), -1.0f, 1.0f);
|
||||
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
|
|
|
|||
|
|
@ -1367,13 +1367,13 @@ void LLAudioSource::pruneSoundLog()
|
|||
{
|
||||
std::map<LLUUID, LLSoundHistoryItem>::iterator iter = gSoundHistory.begin();
|
||||
std::map<LLUUID, LLSoundHistoryItem>::iterator end = gSoundHistory.end();
|
||||
U64 lowest_time = (*iter).second.mTimeStopped;
|
||||
U64 lowest_time = (U64)(*iter).second.mTimeStopped;
|
||||
LLUUID lowest_id = (*iter).first;
|
||||
for ( ; iter != end; ++iter)
|
||||
{
|
||||
if ((*iter).second.mTimeStopped < lowest_time)
|
||||
{
|
||||
lowest_time = (*iter).second.mTimeStopped;
|
||||
lowest_time = (U64)(*iter).second.mTimeStopped;
|
||||
lowest_id = (*iter).first;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ bool LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
|
|||
F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor;
|
||||
|
||||
// roll is critically damped interpolation between current roll and angular velocity-derived target roll
|
||||
mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, U32Milliseconds(100));
|
||||
mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, F32Milliseconds(100.f));
|
||||
|
||||
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
|
||||
mPelvisState->setRotation(roll);
|
||||
|
|
|
|||
|
|
@ -46,8 +46,11 @@
|
|||
template <class Type> class LLPointer
|
||||
{
|
||||
public:
|
||||
template<typename Subclass>
|
||||
friend class LLPointer;
|
||||
|
||||
LLPointer() :
|
||||
mPointer(NULL)
|
||||
mPointer(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +66,12 @@ public:
|
|||
ref();
|
||||
}
|
||||
|
||||
LLPointer(LLPointer<Type>&& ptr) noexcept
|
||||
{
|
||||
mPointer = ptr.mPointer;
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
|
||||
// Support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
|
||||
template<typename Subclass>
|
||||
LLPointer(const LLPointer<Subclass>& ptr) :
|
||||
|
|
@ -71,6 +80,13 @@ public:
|
|||
ref();
|
||||
}
|
||||
|
||||
template<typename Subclass>
|
||||
LLPointer(LLPointer<Subclass>&& ptr) noexcept :
|
||||
mPointer(ptr.get())
|
||||
{
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
|
||||
~LLPointer()
|
||||
{
|
||||
unref();
|
||||
|
|
@ -82,11 +98,11 @@ public:
|
|||
const Type& operator*() const { return *mPointer; }
|
||||
Type& operator*() { return *mPointer; }
|
||||
|
||||
//operator BOOL() const { return (mPointer != NULL); } // <FS:Ansariel> We should not need this anymore
|
||||
operator bool() const { return (mPointer != NULL); }
|
||||
bool operator!() const { return (mPointer == NULL); }
|
||||
bool isNull() const { return (mPointer == NULL); }
|
||||
bool notNull() const { return (mPointer != NULL); }
|
||||
//operator BOOL() const { return (mPointer != nullptr); } // <FS:Ansariel> We should not need this anymore
|
||||
operator bool() const { return (mPointer != nullptr); }
|
||||
bool operator!() const { return (mPointer == nullptr); }
|
||||
bool isNull() const { return (mPointer == nullptr); }
|
||||
bool notNull() const { return (mPointer != nullptr); }
|
||||
|
||||
operator Type*() const { return mPointer; }
|
||||
bool operator !=(Type* ptr) const { return (mPointer != ptr); }
|
||||
|
|
@ -107,6 +123,17 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
LLPointer<Type>& operator =(LLPointer<Type>&& ptr)
|
||||
{
|
||||
if (mPointer != ptr.mPointer)
|
||||
{
|
||||
unref();
|
||||
mPointer = ptr.mPointer;
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
|
||||
template<typename Subclass>
|
||||
LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr)
|
||||
|
|
@ -115,6 +142,18 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
template<typename Subclass>
|
||||
LLPointer<Type>& operator =(LLPointer<Subclass>&& ptr)
|
||||
{
|
||||
if (mPointer != ptr.mPointer)
|
||||
{
|
||||
unref();
|
||||
mPointer = ptr.mPointer;
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Just exchange the pointers, which will not change the reference counts.
|
||||
static void swap(LLPointer<Type>& a, LLPointer<Type>& b)
|
||||
{
|
||||
|
|
@ -141,9 +180,9 @@ protected:
|
|||
if (mPointer)
|
||||
{
|
||||
Type *temp = mPointer;
|
||||
mPointer = NULL;
|
||||
mPointer = nullptr;
|
||||
temp->unref();
|
||||
if (mPointer != NULL)
|
||||
if (mPointer != nullptr)
|
||||
{
|
||||
LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
|
||||
unref();
|
||||
|
|
@ -168,9 +207,11 @@ protected:
|
|||
|
||||
template <class Type> class LLConstPointer
|
||||
{
|
||||
template<typename Subclass>
|
||||
friend class LLConstPointer;
|
||||
public:
|
||||
LLConstPointer() :
|
||||
mPointer(NULL)
|
||||
mPointer(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -186,6 +227,12 @@ public:
|
|||
ref();
|
||||
}
|
||||
|
||||
LLConstPointer(LLConstPointer<Type>&& ptr) noexcept
|
||||
{
|
||||
mPointer = ptr.mPointer;
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
|
||||
// support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
|
||||
template<typename Subclass>
|
||||
LLConstPointer(const LLConstPointer<Subclass>& ptr) :
|
||||
|
|
@ -194,6 +241,13 @@ public:
|
|||
ref();
|
||||
}
|
||||
|
||||
template<typename Subclass>
|
||||
LLConstPointer(LLConstPointer<Subclass>&& ptr) noexcept :
|
||||
mPointer(ptr.get())
|
||||
{
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
|
||||
~LLConstPointer()
|
||||
{
|
||||
unref();
|
||||
|
|
@ -203,11 +257,11 @@ public:
|
|||
const Type* operator->() const { return mPointer; }
|
||||
const Type& operator*() const { return *mPointer; }
|
||||
|
||||
//operator BOOL() const { return (mPointer != NULL); } // <FS:Ansariel> We should not need this anymore
|
||||
operator bool() const { return (mPointer != NULL); }
|
||||
bool operator!() const { return (mPointer == NULL); }
|
||||
bool isNull() const { return (mPointer == NULL); }
|
||||
bool notNull() const { return (mPointer != NULL); }
|
||||
//operator BOOL() const { return (mPointer != nullptr); } // <FS:Ansariel> We should not need this anymore
|
||||
operator bool() const { return (mPointer != nullptr); }
|
||||
bool operator!() const { return (mPointer == nullptr); }
|
||||
bool isNull() const { return (mPointer == nullptr); }
|
||||
bool notNull() const { return (mPointer != nullptr); }
|
||||
|
||||
operator const Type*() const { return mPointer; }
|
||||
bool operator !=(const Type* ptr) const { return (mPointer != ptr); }
|
||||
|
|
@ -239,6 +293,17 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
LLConstPointer<Type>& operator =(LLConstPointer<Type>&& ptr)
|
||||
{
|
||||
if (mPointer != ptr.mPointer)
|
||||
{
|
||||
unref();
|
||||
mPointer = ptr.mPointer;
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
|
||||
template<typename Subclass>
|
||||
LLConstPointer<Type>& operator =(const LLConstPointer<Subclass>& ptr)
|
||||
|
|
@ -252,6 +317,18 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
template<typename Subclass>
|
||||
LLConstPointer<Type>& operator =(LLConstPointer<Subclass>&& ptr)
|
||||
{
|
||||
if (mPointer != ptr.mPointer)
|
||||
{
|
||||
unref();
|
||||
mPointer = ptr.mPointer;
|
||||
ptr.mPointer = nullptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Just exchange the pointers, which will not change the reference counts.
|
||||
static void swap(LLConstPointer<Type>& a, LLConstPointer<Type>& b)
|
||||
{
|
||||
|
|
@ -278,9 +355,9 @@ protected:
|
|||
if (mPointer)
|
||||
{
|
||||
const Type *temp = mPointer;
|
||||
mPointer = NULL;
|
||||
mPointer = nullptr;
|
||||
temp->unref();
|
||||
if (mPointer != NULL)
|
||||
if (mPointer != nullptr)
|
||||
{
|
||||
LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
|
||||
unref();
|
||||
|
|
@ -313,7 +390,7 @@ public:
|
|||
: LLPointer<Type>(ptr),
|
||||
mStayUnique(false)
|
||||
{
|
||||
if (ptr.mForceUnique)
|
||||
if (ptr.mStayUnique)
|
||||
{
|
||||
makeUnique();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,9 +90,6 @@
|
|||
#ifndef LL_MSVC
|
||||
#define LL_MSVC 1
|
||||
#endif
|
||||
#if _MSC_VER < 1400
|
||||
#define LL_MSVC7 //Visual C++ 2003 or earlier
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Deal with minor differences on Unixy OSes.
|
||||
|
|
@ -146,8 +143,6 @@
|
|||
#endif
|
||||
|
||||
// level 4 warnings that we need to disable:
|
||||
#pragma warning (disable : 4244) // possible loss of data on conversions
|
||||
#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
|
||||
#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
|
||||
#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
|
||||
#endif // LL_MSVC
|
||||
|
|
|
|||
|
|
@ -432,12 +432,12 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req)
|
|||
using namespace std::chrono_literals;
|
||||
|
||||
const auto throttle_time = 2ms;
|
||||
if( req->mDeferUntil > LL::WorkQueue::TimePoint::clock::now())
|
||||
if (req->mDeferUntil > LL::WorkQueue::TimePoint::clock::now())
|
||||
{
|
||||
ms_sleep(throttle_time.count());
|
||||
ms_sleep((U32)throttle_time.count());
|
||||
}
|
||||
// if we're still not ready to retry then requeue
|
||||
if( req->mDeferUntil > LL::WorkQueue::TimePoint::clock::now())
|
||||
if (req->mDeferUntil > LL::WorkQueue::TimePoint::clock::now())
|
||||
{
|
||||
LL_PROFILE_ZONE_NAMED("qtpr - defer requeue");
|
||||
|
||||
|
|
@ -506,7 +506,7 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req)
|
|||
|
||||
// if (sleep_time.count() > 0)
|
||||
// {
|
||||
// ms_sleep(sleep_time.count());
|
||||
// ms_sleep((U32)sleep_time.count());
|
||||
// }
|
||||
// }
|
||||
// processRequest(req);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ inline F32 ll_internal_random<F32>()
|
|||
// Per Monty, it's important to clamp using the correct fmodf() rather
|
||||
// than expanding to F64 for fmod() and then truncating back to F32. Prior
|
||||
// to this change, we were getting sporadic ll_frand() == 1.0 results.
|
||||
F32 rv{ narrow<F32>(gRandomGenerator()) };
|
||||
F32 rv{ narrow<F64>(gRandomGenerator()) };
|
||||
if(!((rv >= 0.0f) && (rv < 1.0f))) return fmodf(rv, 1.0f);
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ bool LLParamSDParser::readF32(Parser& parser, void* val_ptr)
|
|||
{
|
||||
LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
|
||||
|
||||
*((F32*)val_ptr) = self.mCurReadSD->asReal();
|
||||
*((F32*)val_ptr) = (F32)self.mCurReadSD->asReal();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, llssize max_bytes)
|
|||
}
|
||||
// Since we've already read 'inbuf' bytes into 'hdr_buf', prepend that
|
||||
// data to whatever remains in 'str'.
|
||||
LLMemoryStreamBuf already(reinterpret_cast<const U8*>(hdr_buf), inbuf);
|
||||
LLMemoryStreamBuf already(reinterpret_cast<const U8*>(hdr_buf), (S32)inbuf);
|
||||
cat_streambuf prebuff(&already, str.rdbuf());
|
||||
std::istream prepend(&prebuff);
|
||||
#if 1
|
||||
|
|
@ -567,7 +567,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) c
|
|||
data,
|
||||
NOTATION_FALSE_SERIAL,
|
||||
false);
|
||||
if(PARSE_FAILURE == cnt) parse_count = cnt;
|
||||
if(PARSE_FAILURE == cnt) parse_count = (S32)cnt;
|
||||
else account(cnt);
|
||||
}
|
||||
else
|
||||
|
|
@ -593,7 +593,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) c
|
|||
if(isalpha(c))
|
||||
{
|
||||
auto cnt = deserialize_boolean(istr,data,NOTATION_TRUE_SERIAL,true);
|
||||
if(PARSE_FAILURE == cnt) parse_count = cnt;
|
||||
if(PARSE_FAILURE == cnt) parse_count = (S32)cnt;
|
||||
else account(cnt);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -567,7 +567,7 @@ void LLSDXMLParser::Impl::parsePart(const char* buf, llssize len)
|
|||
if ( buf != NULL
|
||||
&& len > 0 )
|
||||
{
|
||||
XML_Status status = XML_Parse(mParser, buf, len, false);
|
||||
XML_Status status = XML_Parse(mParser, buf, (int)len, 0);
|
||||
if (status == XML_STATUS_ERROR)
|
||||
{
|
||||
LL_INFOS() << "Unexpected XML parsing error at start" << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@
|
|||
#include "llmainthreadtask.h"
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning( disable : 4506 ) // no definition for inline function
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4506) // no definition for inline function
|
||||
#endif
|
||||
|
||||
class LLSingletonBase: private boost::noncopyable
|
||||
|
|
@ -902,4 +903,8 @@ private:
|
|||
template <class T>
|
||||
T* LLSimpleton<T>::sInstance{ nullptr };
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ LLWString utf16str_to_wstring(const U16* utf16str, size_t len)
|
|||
while (i < len)
|
||||
{
|
||||
llwchar cur_char;
|
||||
i += utf16chars_to_wchar(chars16+i, &cur_char);
|
||||
i += (S32)utf16chars_to_wchar(chars16+i, &cur_char);
|
||||
wout += cur_char;
|
||||
}
|
||||
return wout;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
|
|||
WaitForSingleObject(timer, INFINITE);
|
||||
CloseHandle(timer);
|
||||
#else
|
||||
Sleep(us / 1000);
|
||||
Sleep((DWORD)(us / 1000));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ bool AccumulatorBufferGroup::isCurrent() const
|
|||
return mCounts.isCurrent();
|
||||
}
|
||||
|
||||
void AccumulatorBufferGroup::append( const AccumulatorBufferGroup& other )
|
||||
void AccumulatorBufferGroup::append(const AccumulatorBufferGroup& other)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS;
|
||||
mCounts.addSamples(other.mCounts, SEQUENTIAL);
|
||||
|
|
@ -109,7 +109,7 @@ void AccumulatorBufferGroup::append( const AccumulatorBufferGroup& other )
|
|||
mStackTimers.addSamples(other.mStackTimers, SEQUENTIAL);
|
||||
}
|
||||
|
||||
void AccumulatorBufferGroup::merge( const AccumulatorBufferGroup& other)
|
||||
void AccumulatorBufferGroup::merge(const AccumulatorBufferGroup& other)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS;
|
||||
mCounts.addSamples(other.mCounts, NON_SEQUENTIAL);
|
||||
|
|
@ -140,7 +140,7 @@ void AccumulatorBufferGroup::sync()
|
|||
|
||||
F64 SampleAccumulator::mergeSumsOfSquares(const SampleAccumulator& a, const SampleAccumulator& b)
|
||||
{
|
||||
const F64 epsilon = 0.0000001;
|
||||
constexpr F64 epsilon = 0.0000001;
|
||||
|
||||
if (a.getSamplingTime() > epsilon && b.getSamplingTime() > epsilon)
|
||||
{
|
||||
|
|
@ -170,7 +170,7 @@ F64 SampleAccumulator::mergeSumsOfSquares(const SampleAccumulator& a, const Samp
|
|||
return a.getSumOfSquares();
|
||||
}
|
||||
|
||||
void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppendType append_type )
|
||||
void SampleAccumulator::addSamples(const SampleAccumulator& other, EBufferAppendType append_type)
|
||||
{
|
||||
if (append_type == NON_SEQUENTIAL)
|
||||
{
|
||||
|
|
@ -205,7 +205,7 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen
|
|||
}
|
||||
}
|
||||
|
||||
void SampleAccumulator::reset( const SampleAccumulator* other )
|
||||
void SampleAccumulator::reset(const SampleAccumulator* other)
|
||||
{
|
||||
mLastValue = other ? other->mLastValue : NaN;
|
||||
mHasValue = other ? other->mHasValue : false;
|
||||
|
|
@ -243,7 +243,7 @@ F64 EventAccumulator::mergeSumsOfSquares(const EventAccumulator& a, const EventA
|
|||
return a.mSumOfSquares;
|
||||
}
|
||||
|
||||
void EventAccumulator::addSamples( const EventAccumulator& other, EBufferAppendType append_type )
|
||||
void EventAccumulator::addSamples(const EventAccumulator& other, EBufferAppendType append_type)
|
||||
{
|
||||
if (other.mNumSamples)
|
||||
{
|
||||
|
|
@ -269,12 +269,12 @@ void EventAccumulator::addSamples( const EventAccumulator& other, EBufferAppendT
|
|||
}
|
||||
}
|
||||
|
||||
void EventAccumulator::reset( const EventAccumulator* other )
|
||||
void EventAccumulator::reset(const EventAccumulator* other)
|
||||
{
|
||||
mNumSamples = 0;
|
||||
mSum = 0;
|
||||
mMin = F32(NaN);
|
||||
mMax = F32(NaN);
|
||||
mMin = NaN;
|
||||
mMax = NaN;
|
||||
mMean = NaN;
|
||||
mSumOfSquares = 0;
|
||||
mLastValue = other ? other->mLastValue : NaN;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
namespace LLTrace
|
||||
{
|
||||
const F64 NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
constexpr F64 NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
|
||||
enum EBufferAppendType
|
||||
{
|
||||
|
|
@ -251,8 +251,8 @@ namespace LLTrace
|
|||
|
||||
EventAccumulator()
|
||||
: mSum(0),
|
||||
mMin(F32(NaN)),
|
||||
mMax(F32(NaN)),
|
||||
mMin(NaN),
|
||||
mMax(NaN),
|
||||
mMean(NaN),
|
||||
mSumOfSquares(0),
|
||||
mNumSamples(0),
|
||||
|
|
@ -288,11 +288,11 @@ namespace LLTrace
|
|||
void sync(F64SecondsImplicit) {}
|
||||
|
||||
F64 getSum() const { return mSum; }
|
||||
F32 getMin() const { return mMin; }
|
||||
F32 getMax() const { return mMax; }
|
||||
F64 getMin() const { return mMin; }
|
||||
F64 getMax() const { return mMax; }
|
||||
F64 getLastValue() const { return mLastValue; }
|
||||
F64 getMean() const { return mMean; }
|
||||
F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); }
|
||||
F64 getStandardDeviation() const { return sqrt(mSumOfSquares / mNumSamples); }
|
||||
F64 getSumOfSquares() const { return mSumOfSquares; }
|
||||
S32 getSampleCount() const { return mNumSamples; }
|
||||
bool hasValue() const { return mNumSamples > 0; }
|
||||
|
|
@ -307,7 +307,7 @@ namespace LLTrace
|
|||
F64 mMean,
|
||||
mSumOfSquares;
|
||||
|
||||
F32 mMin,
|
||||
F64 mMin,
|
||||
mMax;
|
||||
|
||||
S32 mNumSamples;
|
||||
|
|
@ -322,8 +322,8 @@ namespace LLTrace
|
|||
|
||||
SampleAccumulator()
|
||||
: mSum(0),
|
||||
mMin(F32(NaN)),
|
||||
mMax(F32(NaN)),
|
||||
mMin(NaN),
|
||||
mMax(NaN),
|
||||
mMean(NaN),
|
||||
mSumOfSquares(0),
|
||||
mLastSampleTimeStamp(0),
|
||||
|
|
@ -378,11 +378,11 @@ namespace LLTrace
|
|||
}
|
||||
|
||||
F64 getSum() const { return mSum; }
|
||||
F32 getMin() const { return mMin; }
|
||||
F32 getMax() const { return mMax; }
|
||||
F64 getMin() const { return mMin; }
|
||||
F64 getMax() const { return mMax; }
|
||||
F64 getLastValue() const { return mLastValue; }
|
||||
F64 getMean() const { return mMean; }
|
||||
F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); }
|
||||
F64 getStandardDeviation() const { return sqrt(mSumOfSquares / mTotalSamplingTime); }
|
||||
F64 getSumOfSquares() const { return mSumOfSquares; }
|
||||
F64SecondsImplicit getSamplingTime() const { return mTotalSamplingTime; }
|
||||
S32 getSampleCount() const { return mNumSamples; }
|
||||
|
|
@ -402,7 +402,7 @@ namespace LLTrace
|
|||
mLastSampleTimeStamp,
|
||||
mTotalSamplingTime;
|
||||
|
||||
F32 mMin,
|
||||
F64 mMin,
|
||||
mMax;
|
||||
|
||||
S32 mNumSamples;
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ F32 Recording::getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& s
|
|||
update();
|
||||
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
|
||||
const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
|
||||
return (F32)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / mElapsedSeconds.value();
|
||||
return (F32)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / (F32)mElapsedSeconds.value();
|
||||
}
|
||||
|
||||
bool Recording::hasValue(const StatType<CountAccumulator>& stat)
|
||||
|
|
@ -296,11 +296,11 @@ F64 Recording::getMean( const StatType<SampleAccumulator>& stat )
|
|||
const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
|
||||
if (active_accumulator && active_accumulator->hasValue())
|
||||
{
|
||||
F32 t = 0.0f;
|
||||
F64 t = 0.0;
|
||||
S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount();
|
||||
if (div > 0)
|
||||
{
|
||||
t = active_accumulator->getSampleCount() / div;
|
||||
t = (F64)active_accumulator->getSampleCount() / (F64)div;
|
||||
}
|
||||
return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
|
||||
}
|
||||
|
|
@ -319,7 +319,7 @@ F64 Recording::getStandardDeviation( const StatType<SampleAccumulator>& stat )
|
|||
if (active_accumulator && active_accumulator->hasValue())
|
||||
{
|
||||
F64 sum_of_squares = SampleAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
|
||||
return sqrtf(sum_of_squares / (accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
|
||||
return sqrt(sum_of_squares / (F64)(accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -382,11 +382,11 @@ F64 Recording::getMean( const StatType<EventAccumulator>& stat )
|
|||
const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
|
||||
if (active_accumulator && active_accumulator->hasValue())
|
||||
{
|
||||
F32 t = 0.0f;
|
||||
F64 t = 0.0;
|
||||
S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount();
|
||||
if (div > 0)
|
||||
{
|
||||
t = active_accumulator->getSampleCount() / div;
|
||||
t = (F64)active_accumulator->getSampleCount() / (F64)div;
|
||||
}
|
||||
return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
|
||||
}
|
||||
|
|
@ -405,7 +405,7 @@ F64 Recording::getStandardDeviation( const StatType<EventAccumulator>& stat )
|
|||
if (active_accumulator && active_accumulator->hasValue())
|
||||
{
|
||||
F64 sum_of_squares = EventAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
|
||||
return sqrtf(sum_of_squares / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
|
||||
return sqrt(sum_of_squares / (F64)(accumulator.getSampleCount() + active_accumulator->getSampleCount()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@
|
|||
#include "llpointer.h"
|
||||
#include <limits>
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4244) // possible loss of data on conversions
|
||||
#endif
|
||||
|
||||
class LLStopWatchControlsMixinCommon
|
||||
{
|
||||
public:
|
||||
|
|
@ -714,4 +719,8 @@ namespace LLTrace
|
|||
};
|
||||
}
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // LL_LLTRACERECORDING_H
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@
|
|||
#include "llpreprocessor.h"
|
||||
#include "llerror.h"
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4244) // possible loss of data on conversions
|
||||
#endif
|
||||
|
||||
//lightweight replacement of type traits for simple type equality check
|
||||
template<typename S, typename T>
|
||||
struct LLIsSameType
|
||||
|
|
@ -846,4 +851,8 @@ LL_FORCE_INLINE S2 ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, un
|
|||
typedef LLUnit<U64, ns::unit_name> U64##unit_name; \
|
||||
typedef LLUnitImplicit<U64, ns::unit_name> U64##unit_name##Implicit
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif //LL_UNITTYPE_H
|
||||
|
|
|
|||
|
|
@ -81,13 +81,13 @@ class TestEventThrottle: public LLEventThrottleBase
|
|||
public:
|
||||
TestEventThrottle(F32 interval):
|
||||
LLEventThrottleBase(interval),
|
||||
mAlarmRemaining(-1),
|
||||
mTimerRemaining(-1)
|
||||
mAlarmRemaining(-1.f),
|
||||
mTimerRemaining(-1.f)
|
||||
{}
|
||||
TestEventThrottle(LLEventPump& source, F32 interval):
|
||||
LLEventThrottleBase(source, interval),
|
||||
mAlarmRemaining(-1),
|
||||
mTimerRemaining(-1)
|
||||
mAlarmRemaining(-1.f),
|
||||
mTimerRemaining(-1.f)
|
||||
{}
|
||||
|
||||
/*----- implementation of LLEventThrottleBase timing functionality -----*/
|
||||
|
|
@ -100,12 +100,12 @@ public:
|
|||
virtual bool alarmRunning() const /*override*/
|
||||
{
|
||||
// decrementing to exactly 0 should mean the alarm fires
|
||||
return mAlarmRemaining > 0;
|
||||
return mAlarmRemaining > 0.f;
|
||||
}
|
||||
|
||||
virtual void alarmCancel() /*override*/
|
||||
{
|
||||
mAlarmRemaining = -1;
|
||||
mAlarmRemaining = -1.f;
|
||||
}
|
||||
|
||||
virtual void timerSet(F32 interval) /*override*/
|
||||
|
|
@ -116,7 +116,7 @@ public:
|
|||
virtual F32 timerGetRemaining() const /*override*/
|
||||
{
|
||||
// LLTimer.getRemainingTimeF32() never returns negative; 0.0 means expired
|
||||
return (mTimerRemaining > 0.0)? mTimerRemaining : 0.0;
|
||||
return (mTimerRemaining > 0.0f)? mTimerRemaining : 0.0f;
|
||||
}
|
||||
|
||||
/*------------------- methods for manipulating time --------------------*/
|
||||
|
|
|
|||
|
|
@ -1809,7 +1809,7 @@ namespace tut
|
|||
std::string q("\"");
|
||||
std::string qPYTHON(q + PYTHON + q);
|
||||
std::string qscript(q + scriptfile.getName() + q);
|
||||
int rc = _spawnl(_P_WAIT, PYTHON.c_str(), qPYTHON.c_str(), qscript.c_str(),
|
||||
int rc = (int)_spawnl(_P_WAIT, PYTHON.c_str(), qPYTHON.c_str(), qscript.c_str(),
|
||||
std::forward<ARGS>(args)..., NULL);
|
||||
if (rc == -1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@
|
|||
#include "lltracerecording.h"
|
||||
#include "../test/lltut.h"
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(disable : 4244) // possible loss of data on conversions
|
||||
#endif
|
||||
|
||||
namespace LLUnits
|
||||
{
|
||||
// using powers of 2 to allow strict floating point equality
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ namespace tut
|
|||
F32 float_val = quatloos_implicit;
|
||||
ensure("implicit units convert implicitly to regular values", float_val == 16);
|
||||
|
||||
S32 int_val = quatloos_implicit;
|
||||
S32 int_val = (S32)quatloos_implicit;
|
||||
ensure("implicit units convert implicitly to regular values", int_val == 16);
|
||||
|
||||
// conversion of implicits
|
||||
|
|
|
|||
|
|
@ -106,17 +106,17 @@ namespace LLCore
|
|||
// Maxium number of policy classes that can be defined.
|
||||
// *TODO: Currently limited to the default class + 1, extend.
|
||||
// (TSN: should this be more dynamically sized. Is there a reason to hard limit the number of policies?)
|
||||
const int HTTP_POLICY_CLASS_LIMIT = 32;
|
||||
constexpr int HTTP_POLICY_CLASS_LIMIT = 32;
|
||||
|
||||
// Debug/informational tracing. Used both
|
||||
// as a global option and in per-request traces.
|
||||
const int HTTP_TRACE_OFF = 0;
|
||||
const int HTTP_TRACE_LOW = 1;
|
||||
const int HTTP_TRACE_CURL_HEADERS = 2;
|
||||
const int HTTP_TRACE_CURL_BODIES = 3;
|
||||
constexpr int HTTP_TRACE_OFF = 0;
|
||||
constexpr int HTTP_TRACE_LOW = 1;
|
||||
constexpr int HTTP_TRACE_CURL_HEADERS = 2;
|
||||
constexpr int HTTP_TRACE_CURL_BODIES = 3;
|
||||
|
||||
const int HTTP_TRACE_MIN = HTTP_TRACE_OFF;
|
||||
const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES;
|
||||
constexpr int HTTP_TRACE_MIN = HTTP_TRACE_OFF;
|
||||
constexpr int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES;
|
||||
|
||||
// Request retry limits
|
||||
//
|
||||
|
|
@ -127,41 +127,41 @@ const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES;
|
|||
// We want to span a few windows to allow transport to slow
|
||||
// after onset of the throttles and then recover without a final
|
||||
// failure. Other systems may need other constants.
|
||||
const int HTTP_RETRY_COUNT_DEFAULT = 5;
|
||||
const int HTTP_RETRY_COUNT_MIN = 0;
|
||||
const int HTTP_RETRY_COUNT_MAX = 100;
|
||||
const HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1E6L; // 1 sec
|
||||
const HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 5E6L; // 5 sec
|
||||
const HttpTime HTTP_RETRY_BACKOFF_MAX = 20E6L; // 20 sec
|
||||
constexpr int HTTP_RETRY_COUNT_DEFAULT = 5;
|
||||
constexpr int HTTP_RETRY_COUNT_MIN = 0;
|
||||
constexpr int HTTP_RETRY_COUNT_MAX = 100;
|
||||
constexpr HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1000000UL; // 1 sec
|
||||
constexpr HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 50000006UL; // 5 sec
|
||||
constexpr HttpTime HTTP_RETRY_BACKOFF_MAX = 20000000UL; // 20 sec
|
||||
|
||||
const int HTTP_REDIRECTS_DEFAULT = 10;
|
||||
constexpr int HTTP_REDIRECTS_DEFAULT = 10;
|
||||
|
||||
// Timeout value used for both connect and protocol exchange.
|
||||
// Retries and time-on-queue are not included and aren't
|
||||
// accounted for.
|
||||
const long HTTP_REQUEST_TIMEOUT_DEFAULT = 30L;
|
||||
const long HTTP_REQUEST_XFER_TIMEOUT_DEFAULT = 0L;
|
||||
const long HTTP_REQUEST_TIMEOUT_MIN = 0L;
|
||||
const long HTTP_REQUEST_TIMEOUT_MAX = 3600L;
|
||||
constexpr long HTTP_REQUEST_TIMEOUT_DEFAULT = 30L;
|
||||
constexpr long HTTP_REQUEST_XFER_TIMEOUT_DEFAULT = 0L;
|
||||
constexpr long HTTP_REQUEST_TIMEOUT_MIN = 0L;
|
||||
constexpr long HTTP_REQUEST_TIMEOUT_MAX = 3600L;
|
||||
|
||||
// Limits on connection counts
|
||||
const int HTTP_CONNECTION_LIMIT_DEFAULT = 8;
|
||||
const int HTTP_CONNECTION_LIMIT_MIN = 1;
|
||||
const int HTTP_CONNECTION_LIMIT_MAX = 256;
|
||||
constexpr int HTTP_CONNECTION_LIMIT_DEFAULT = 8;
|
||||
constexpr int HTTP_CONNECTION_LIMIT_MIN = 1;
|
||||
constexpr int HTTP_CONNECTION_LIMIT_MAX = 256;
|
||||
|
||||
// Pipelining limits
|
||||
const long HTTP_PIPELINING_DEFAULT = 0L;
|
||||
const long HTTP_PIPELINING_MAX = 20L;
|
||||
constexpr long HTTP_PIPELINING_DEFAULT = 0L;
|
||||
constexpr long HTTP_PIPELINING_MAX = 20L;
|
||||
|
||||
// Miscellaneous defaults
|
||||
const bool HTTP_USE_RETRY_AFTER_DEFAULT = true;
|
||||
const long HTTP_THROTTLE_RATE_DEFAULT = 0L;
|
||||
constexpr bool HTTP_USE_RETRY_AFTER_DEFAULT = true;
|
||||
constexpr long HTTP_THROTTLE_RATE_DEFAULT = 0L;
|
||||
|
||||
// Tuning parameters
|
||||
|
||||
// Time worker thread sleeps after a pass through the
|
||||
// request, ready and active queues.
|
||||
const int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2;
|
||||
constexpr int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2;
|
||||
|
||||
// Block allocation size (a tuning parameter) is found
|
||||
// in bufferarray.h.
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ namespace LLCore
|
|||
|
||||
void recordDataDown(size_t bytes)
|
||||
{
|
||||
mDataDown.push(bytes);
|
||||
mDataDown.push((F32)bytes);
|
||||
}
|
||||
|
||||
void recordDataUp(size_t bytes)
|
||||
{
|
||||
mDataUp.push(bytes);
|
||||
mDataUp.push((F32)bytes);
|
||||
}
|
||||
|
||||
void recordHTTPRequest() { ++mRequests; }
|
||||
|
|
|
|||
|
|
@ -45,11 +45,10 @@
|
|||
|
||||
bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname)
|
||||
{
|
||||
std::wstring wpname;
|
||||
wpname = std::wstring(pname.begin(), pname.end());
|
||||
std::wstring wpname = ll_convert_string_to_wide(pname);
|
||||
|
||||
HANDLE snapshot;
|
||||
PROCESSENTRY32 pe32;
|
||||
PROCESSENTRY32 pe32{};
|
||||
|
||||
bool matched = false;
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname)
|
|||
{
|
||||
do {
|
||||
std::wstring wexecname = pe32.szExeFile;
|
||||
std::string execname = std::string(wexecname.begin(), wexecname.end());
|
||||
std::string execname = ll_convert_wide_to_string(wexecname);
|
||||
if (!wpname.compare(pe32.szExeFile))
|
||||
{
|
||||
if (pid == (U32)pe32.th32ProcessID)
|
||||
|
|
|
|||
|
|
@ -207,15 +207,15 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
|
|||
boost::filesystem::path dir_path(dir_name);
|
||||
#endif
|
||||
|
||||
if (boost::filesystem::exists (dir_path))
|
||||
if (boost::filesystem::exists(dir_path))
|
||||
{
|
||||
if (!boost::filesystem::is_empty (dir_path))
|
||||
if (!boost::filesystem::is_empty(dir_path))
|
||||
{ // Directory has content
|
||||
num_deleted = boost::filesystem::remove_all (dir_path);
|
||||
num_deleted = (U32)boost::filesystem::remove_all(dir_path);
|
||||
}
|
||||
else
|
||||
{ // Directory is empty
|
||||
boost::filesystem::remove (dir_path);
|
||||
boost::filesystem::remove(dir_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ void LLDiskCache::purge()
|
|||
|
||||
// Log afterward so it doesn't affect the time measurement
|
||||
// Logging thousands of file results can take hundreds of milliseconds
|
||||
auto deleted_so_far = 0; // <FS:Beq/> update the debug logging to be more useful
|
||||
uintmax_t deleted_so_far{ 0 }; // <FS:Beq/> update the debug logging to be more useful
|
||||
for (size_t i = 0; i < file_info.size(); ++i)
|
||||
{
|
||||
const file_info_t& entry = file_info[i];
|
||||
|
|
@ -289,7 +289,8 @@ void LLDiskCache::purge()
|
|||
auto& filename{ entry.second.second };
|
||||
if (file_removed.find(filename) != file_removed.end()) {
|
||||
// File found in the map, retrieve the corresponding enum value
|
||||
switch (file_removed[filename]) {
|
||||
switch (file_removed[filename])
|
||||
{
|
||||
case purge_action::delete_file:
|
||||
action = "DELETE";
|
||||
del++;
|
||||
|
|
@ -485,8 +486,8 @@ const std::string LLDiskCache::getCacheInfo()
|
|||
{
|
||||
std::ostringstream cache_info;
|
||||
|
||||
F32 max_in_mb = (F32)mMaxSizeBytes / (1024.0 * 1024.0);
|
||||
F32 percent_used = ((F32)dirFileSize(mCacheDir) / (F32)mMaxSizeBytes) * 100.0;
|
||||
F32 max_in_mb = (F32)mMaxSizeBytes / (1024.0f * 1024.0f);
|
||||
F32 percent_used = ((F32)dirFileSize(mCacheDir) / (F32)mMaxSizeBytes) * 100.0f;
|
||||
|
||||
cache_info << std::fixed;
|
||||
cache_info << std::setprecision(1);
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType fi
|
|||
//if (file.is_open())
|
||||
//{
|
||||
// file.seekg(0, std::ios::end);
|
||||
// file_size = file.tellg();
|
||||
// file_size = (S32)file.tellg();
|
||||
//}
|
||||
llstat file_stat;
|
||||
if (LLFile::stat(filename, &file_stat) == 0)
|
||||
|
|
@ -196,7 +196,7 @@ bool LLFileSystem::read(U8* buffer, S32 bytes)
|
|||
// }
|
||||
// else
|
||||
// {
|
||||
// mBytesRead = file.gcount();
|
||||
// mBytesRead = (S32)file.gcount();
|
||||
// }
|
||||
|
||||
// file.close();
|
||||
|
|
@ -259,7 +259,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
|
|||
// {
|
||||
// ofs.write((const char*)buffer, bytes);
|
||||
|
||||
// mPosition = ofs.tellp(); // <FS:Ansariel> Fix asset caching
|
||||
// mPosition = (S32)ofs.tellp(); // <FS:Ansariel> Fix asset caching
|
||||
|
||||
// success = true;
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
|
|||
bool abs_value = (mFilterData[i][index++].asReal() > 0.0);
|
||||
for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
|
||||
for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
|
||||
kernel.mMatrix[k][j] = mFilterData[i][index++].asReal();
|
||||
kernel.mMatrix[k][j] = (F32)mFilterData[i][index++].asReal();
|
||||
convolve(kernel,normalize,abs_value);
|
||||
}
|
||||
else if (filter_name == "colortransform")
|
||||
|
|
@ -262,7 +262,7 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
|
|||
S32 index = 1;
|
||||
for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
|
||||
for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
|
||||
transform.mMatrix[k][j] = mFilterData[i][index++].asReal();
|
||||
transform.mMatrix[k][j] = (F32)mFilterData[i][index++].asReal();
|
||||
transform.transpose();
|
||||
colorTransform(transform);
|
||||
}
|
||||
|
|
@ -279,32 +279,32 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
|
|||
|
||||
void LLImageFilter::blendStencil(F32 alpha, U8* pixel, U8 red, U8 green, U8 blue)
|
||||
{
|
||||
F32 inv_alpha = 1.0 - alpha;
|
||||
F32 inv_alpha = 1.0f - alpha;
|
||||
switch (mStencilBlendMode)
|
||||
{
|
||||
case STENCIL_BLEND_MODE_BLEND:
|
||||
// Classic blend of incoming color with the background image
|
||||
pixel[VRED] = inv_alpha * pixel[VRED] + alpha * red;
|
||||
pixel[VGREEN] = inv_alpha * pixel[VGREEN] + alpha * green;
|
||||
pixel[VBLUE] = inv_alpha * pixel[VBLUE] + alpha * blue;
|
||||
pixel[VRED] = (U8)(inv_alpha * pixel[VRED] + alpha * red);
|
||||
pixel[VGREEN] = (U8)(inv_alpha * pixel[VGREEN] + alpha * green);
|
||||
pixel[VBLUE] = (U8)(inv_alpha * pixel[VBLUE] + alpha * blue);
|
||||
break;
|
||||
case STENCIL_BLEND_MODE_ADD:
|
||||
// Add incoming color to the background image
|
||||
pixel[VRED] = llclampb(pixel[VRED] + alpha * red);
|
||||
pixel[VGREEN] = llclampb(pixel[VGREEN] + alpha * green);
|
||||
pixel[VBLUE] = llclampb(pixel[VBLUE] + alpha * blue);
|
||||
pixel[VRED] = (U8)llclampb(pixel[VRED] + alpha * red);
|
||||
pixel[VGREEN] = (U8)llclampb(pixel[VGREEN] + alpha * green);
|
||||
pixel[VBLUE] = (U8)llclampb(pixel[VBLUE] + alpha * blue);
|
||||
break;
|
||||
case STENCIL_BLEND_MODE_ABACK:
|
||||
// Add back background image to the incoming color
|
||||
pixel[VRED] = llclampb(inv_alpha * pixel[VRED] + red);
|
||||
pixel[VGREEN] = llclampb(inv_alpha * pixel[VGREEN] + green);
|
||||
pixel[VBLUE] = llclampb(inv_alpha * pixel[VBLUE] + blue);
|
||||
pixel[VRED] = (U8)llclampb(inv_alpha * pixel[VRED] + red);
|
||||
pixel[VGREEN] = (U8)llclampb(inv_alpha * pixel[VGREEN] + green);
|
||||
pixel[VBLUE] = (U8)llclampb(inv_alpha * pixel[VBLUE] + blue);
|
||||
break;
|
||||
case STENCIL_BLEND_MODE_FADE:
|
||||
// Fade incoming color to black
|
||||
pixel[VRED] = alpha * red;
|
||||
pixel[VGREEN] = alpha * green;
|
||||
pixel[VBLUE] = alpha * blue;
|
||||
pixel[VRED] = (U8)(alpha * red);
|
||||
pixel[VGREEN] = (U8)(alpha * green);
|
||||
pixel[VBLUE] = (U8)(alpha * blue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -348,7 +348,7 @@ void LLImageFilter::colorTransform(const LLMatrix3 &transform)
|
|||
dst.clamp(0.0f,255.0f);
|
||||
|
||||
// Blend result
|
||||
blendStencil(getStencilAlpha(i,j), dst_data, dst.mV[VRED], dst.mV[VGREEN], dst.mV[VBLUE]);
|
||||
blendStencil(getStencilAlpha(i,j), dst_data, (U8)dst.mV[VRED], (U8)dst.mV[VGREEN], (U8)dst.mV[VBLUE]);
|
||||
dst_data += components;
|
||||
}
|
||||
}
|
||||
|
|
@ -463,7 +463,7 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v
|
|||
dst.clamp(0.0f,255.0f);
|
||||
|
||||
// Blend result
|
||||
blendStencil(getStencilAlpha(i,j), dst_data, dst.mV[VRED], dst.mV[VGREEN], dst.mV[VBLUE]);
|
||||
blendStencil(getStencilAlpha(i,j), dst_data, (U8)dst.mV[VRED], (U8)dst.mV[VGREEN], (U8)dst.mV[VBLUE]);
|
||||
|
||||
// Next pixel
|
||||
dst_data += components;
|
||||
|
|
@ -499,7 +499,7 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
|
|||
S32 width = mImage->getWidth();
|
||||
S32 height = mImage->getHeight();
|
||||
|
||||
F32 wave_length_pixels = wave_length * (F32)(height) / 2.0;
|
||||
F32 wave_length_pixels = wave_length * (F32)(height) / 2.0f;
|
||||
F32 sin = sinf(angle*DEG_TO_RAD);
|
||||
F32 cos = cosf(angle*DEG_TO_RAD);
|
||||
|
||||
|
|
@ -507,7 +507,7 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
|
|||
U8 gamma[256];
|
||||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/4.0)));
|
||||
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0f,1.0f/4.0f)));
|
||||
gamma[i] = (U8)(255.0 * gamma_i);
|
||||
}
|
||||
|
||||
|
|
@ -525,11 +525,11 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
|
|||
case SCREEN_MODE_2DSINE:
|
||||
di = cos*i + sin*j;
|
||||
dj = -sin*i + cos*j;
|
||||
value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
|
||||
value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/wave_length_pixels)+1.0f)*255.0f/2.0f;
|
||||
break;
|
||||
case SCREEN_MODE_LINE:
|
||||
dj = sin*i - cos*j;
|
||||
value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
|
||||
value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0f)*255.0f/2.0f;
|
||||
break;
|
||||
}
|
||||
U8 dst_value = (dst_data[VRED] >= (U8)(value) ? gamma[dst_data[VRED] - (U8)(value)] : 0);
|
||||
|
|
@ -556,16 +556,16 @@ void LLImageFilter::setStencil(EStencilShape shape, EStencilBlendMode mode, F32
|
|||
mStencilCenterX = (S32)(mImage->getWidth() + params[0] * (F32)(mImage->getHeight()))/2;
|
||||
mStencilCenterY = (S32)(mImage->getHeight() + params[1] * (F32)(mImage->getHeight()))/2;
|
||||
mStencilWidth = (S32)(params[2] * (F32)(mImage->getHeight()))/2;
|
||||
mStencilGamma = (params[3] <= 0.0 ? 1.0 : params[3]);
|
||||
mStencilGamma = (params[3] <= 0.0f ? 1.0f : params[3]);
|
||||
|
||||
mStencilWavelength = (params[0] <= 0.0 ? 10.0 : params[0] * (F32)(mImage->getHeight()) / 2.0);
|
||||
mStencilWavelength = (params[0] <= 0.0f ? 10.0f : params[0] * (F32)(mImage->getHeight()) / 2.0f);
|
||||
mStencilSine = sinf(params[1]*DEG_TO_RAD);
|
||||
mStencilCosine = cosf(params[1]*DEG_TO_RAD);
|
||||
|
||||
mStencilStartX = ((F32)(mImage->getWidth()) + params[0] * (F32)(mImage->getHeight()))/2.0;
|
||||
mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0;
|
||||
F32 end_x = ((F32)(mImage->getWidth()) + params[2] * (F32)(mImage->getHeight()))/2.0;
|
||||
F32 end_y = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0;
|
||||
mStencilStartX = ((F32)(mImage->getWidth()) + params[0] * (F32)(mImage->getHeight()))/2.0f;
|
||||
mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0f;
|
||||
F32 end_x = ((F32)(mImage->getWidth()) + params[2] * (F32)(mImage->getHeight()))/2.0f;
|
||||
F32 end_y = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0f;
|
||||
mStencilGradX = end_x - mStencilStartX;
|
||||
mStencilGradY = end_y - mStencilStartY;
|
||||
mStencilGradN = mStencilGradX*mStencilGradX + mStencilGradY*mStencilGradY;
|
||||
|
|
@ -578,14 +578,14 @@ F32 LLImageFilter::getStencilAlpha(S32 i, S32 j)
|
|||
{
|
||||
// alpha is a modified gaussian value, with a center and fading in a circular pattern toward the edges
|
||||
// The gamma parameter controls the intensity of the drop down from alpha 1.0 (center) to 0.0
|
||||
F32 d_center_square = (i - mStencilCenterX)*(i - mStencilCenterX) + (j - mStencilCenterY)*(j - mStencilCenterY);
|
||||
F32 d_center_square = (F32)((i - mStencilCenterX)*(i - mStencilCenterX) + (j - mStencilCenterY)*(j - mStencilCenterY));
|
||||
alpha = powf(F_E, -(powf((d_center_square/(mStencilWidth*mStencilWidth)),mStencilGamma)/2.0f));
|
||||
}
|
||||
else if (mStencilShape == STENCIL_SHAPE_SCAN_LINES)
|
||||
{
|
||||
// alpha varies according to a squared sine function.
|
||||
F32 d = mStencilSine*i - mStencilCosine*j;
|
||||
alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0 ? 1.0 : 0.0);
|
||||
alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0f ? 1.0f : 0.0f);
|
||||
}
|
||||
else if (mStencilShape == STENCIL_SHAPE_GRADIENT)
|
||||
{
|
||||
|
|
@ -756,11 +756,11 @@ void LLImageFilter::filterGamma(F32 gamma, const LLColor3& alpha)
|
|||
|
||||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/gamma)));
|
||||
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0f,1.0f/gamma)));
|
||||
// Blend in with alpha values
|
||||
gamma_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0 * gamma_i);
|
||||
gamma_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0 * gamma_i);
|
||||
gamma_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0 * gamma_i);
|
||||
gamma_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0f * gamma_i);
|
||||
gamma_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0f * gamma_i);
|
||||
gamma_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0f * gamma_i);
|
||||
}
|
||||
|
||||
colorCorrect(gamma_red_lut,gamma_green_lut,gamma_blue_lut);
|
||||
|
|
@ -808,23 +808,23 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
|
|||
{
|
||||
U8 value_i = (i < min_v ? 0 : 255);
|
||||
// Blend in with alpha values
|
||||
linear_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
linear_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
linear_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
linear_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
linear_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Linearize between min and max
|
||||
F32 slope = 255.0 / (F32)(max_v - min_v);
|
||||
F32 slope = 255.0f / (F32)(max_v - min_v);
|
||||
F32 translate = -min_v * slope;
|
||||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
|
||||
// Blend in with alpha values
|
||||
linear_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
linear_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
linear_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
linear_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
linear_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -863,9 +863,9 @@ void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
|
|||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
// Blend in current_value with alpha values
|
||||
equalize_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
|
||||
equalize_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
|
||||
equalize_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
|
||||
equalize_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
|
||||
equalize_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
|
||||
equalize_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
|
||||
if (cumulated_histo[i] >= current_count)
|
||||
{
|
||||
current_count += delta_count;
|
||||
|
|
@ -884,15 +884,15 @@ void LLImageFilter::filterColorize(const LLColor3& color, const LLColor3& alpha)
|
|||
U8 green_lut[256];
|
||||
U8 blue_lut[256];
|
||||
|
||||
F32 red_composite = 255.0 * alpha.mV[0] * color.mV[0];
|
||||
F32 green_composite = 255.0 * alpha.mV[1] * color.mV[1];
|
||||
F32 blue_composite = 255.0 * alpha.mV[2] * color.mV[2];
|
||||
F32 red_composite = 255.0f * alpha.mV[0] * color.mV[0];
|
||||
F32 green_composite = 255.0f * alpha.mV[1] * color.mV[1];
|
||||
F32 blue_composite = 255.0f * alpha.mV[2] * color.mV[2];
|
||||
|
||||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
red_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[0]) * (F32)(i) + red_composite)));
|
||||
green_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[1]) * (F32)(i) + green_composite)));
|
||||
blue_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[2]) * (F32)(i) + blue_composite)));
|
||||
red_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[0]) * (F32)(i) + red_composite)));
|
||||
green_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[1]) * (F32)(i) + green_composite)));
|
||||
blue_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[2]) * (F32)(i) + blue_composite)));
|
||||
}
|
||||
|
||||
colorCorrect(red_lut,green_lut,blue_lut);
|
||||
|
|
@ -904,15 +904,15 @@ void LLImageFilter::filterContrast(F32 slope, const LLColor3& alpha)
|
|||
U8 contrast_green_lut[256];
|
||||
U8 contrast_blue_lut[256];
|
||||
|
||||
F32 translate = 128.0 * (1.0 - slope);
|
||||
F32 translate = 128.0f * (1.0f - slope);
|
||||
|
||||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
|
||||
// Blend in with alpha values
|
||||
contrast_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
contrast_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
contrast_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
contrast_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
contrast_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
contrast_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
}
|
||||
|
||||
colorCorrect(contrast_red_lut,contrast_green_lut,contrast_blue_lut);
|
||||
|
|
@ -924,15 +924,15 @@ void LLImageFilter::filterBrightness(F32 add, const LLColor3& alpha)
|
|||
U8 brightness_green_lut[256];
|
||||
U8 brightness_blue_lut[256];
|
||||
|
||||
S32 add_value = (S32)(add * 255.0);
|
||||
S32 add_value = (S32)(add * 255.0f);
|
||||
|
||||
for (S32 i = 0; i < 256; i++)
|
||||
{
|
||||
U8 value_i = (U8)(llclampb(i + add_value));
|
||||
// Blend in with alpha values
|
||||
brightness_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
brightness_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
brightness_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
brightness_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
|
||||
brightness_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
|
||||
brightness_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
|
||||
}
|
||||
|
||||
colorCorrect(brightness_red_lut,brightness_green_lut,brightness_blue_lut);
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ public:
|
|||
{
|
||||
// "append" (set) the data we "streamed" (memcopied) for writing to the formatted image
|
||||
// with side-effect of setting the actually encoded size to same
|
||||
compressedImageOut.allocateData(offset);
|
||||
compressedImageOut.allocateData((S32)offset);
|
||||
memcpy(compressedImageOut.getData(), buffer, offset);
|
||||
compressedImageOut.updateData(); // update width, height etc from header
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1269,7 +1269,7 @@ void LLParcel::setExperienceKeyType( const LLUUID& experience_key, U32 type )
|
|||
|
||||
U32 LLParcel::countExperienceKeyType( U32 type )
|
||||
{
|
||||
return std::count_if(
|
||||
return (U32)std::count_if(
|
||||
boost::begin(mExperienceKeys | boost::adaptors::map_values),
|
||||
boost::end(mExperienceKeys | boost::adaptors::map_values),
|
||||
[type](U32 key){ return (key == type); });
|
||||
|
|
|
|||
|
|
@ -278,11 +278,11 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD
|
|||
{
|
||||
case LLSD::TypeInteger:
|
||||
// lerp between the two values rounding the result to the nearest integer.
|
||||
new_value = LLSD::Integer(llroundf(lerp(value.asReal(), other_value.asReal(), mix)));
|
||||
new_value = LLSD::Integer(llroundf(lerp((F32)value.asReal(), (F32)other_value.asReal(), (F32)mix)));
|
||||
break;
|
||||
case LLSD::TypeReal:
|
||||
// lerp between the two values.
|
||||
new_value = LLSD::Real(lerp(value.asReal(), other_value.asReal(), mix));
|
||||
new_value = LLSD::Real(lerp((F32)value.asReal(), (F32)other_value.asReal(), (F32)mix));
|
||||
break;
|
||||
case LLSD::TypeMap:
|
||||
// deep copy.
|
||||
|
|
@ -297,7 +297,7 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD
|
|||
{
|
||||
LLQuaternion a(value);
|
||||
LLQuaternion b(other_value);
|
||||
LLQuaternion q = slerp(mix, a, b);
|
||||
LLQuaternion q = slerp((F32)mix, a, b);
|
||||
new_array = q.getValue();
|
||||
}
|
||||
else
|
||||
|
|
@ -308,7 +308,7 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD
|
|||
for (size_t i = 0; i < len; ++i)
|
||||
{
|
||||
|
||||
new_array[i] = lerp(value[i].asReal(), other_value[i].asReal(), mix);
|
||||
new_array[i] = lerp((F32)value[i].asReal(), (F32)other_value[i].asReal(), (F32)mix);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -693,7 +693,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf)
|
|||
|
||||
F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in)
|
||||
{
|
||||
LLSettingsBase::TrackPosition blendf = blendf_in;
|
||||
LLSettingsBase::TrackPosition blendf = (F32)blendf_in;
|
||||
llassert(!isnan(blendf));
|
||||
if (blendf >= 1.0)
|
||||
{
|
||||
|
|
@ -744,7 +744,7 @@ bool LLSettingsBlenderTimeDelta::applyTimeDelta(const LLSettingsBase::Seconds& t
|
|||
return false;
|
||||
}
|
||||
|
||||
LLSettingsBase::BlendFactor blendf = calculateBlend(mTimeSpent, mBlendSpan);
|
||||
LLSettingsBase::BlendFactor blendf = calculateBlend((F32)mTimeSpent.value(), mBlendSpan);
|
||||
|
||||
if (fabs(mLastBlendF - blendf) < mBlendFMinDelta)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ public:
|
|||
LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target,
|
||||
const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& blend_span) :
|
||||
LLSettingsBlender(target, initsetting, endsetting),
|
||||
mBlendSpan(blend_span),
|
||||
mBlendSpan((F32)blend_span.value()),
|
||||
mLastUpdate(0.0f),
|
||||
mTimeSpent(0.0f),
|
||||
mBlendFMinDelta(MIN_BLEND_DELTA),
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ namespace
|
|||
continue;
|
||||
}
|
||||
|
||||
LLSettingsBase::TrackPosition frame = elem[LLSettingsDay::SETTING_KEYKFRAME].asReal();
|
||||
LLSettingsBase::TrackPosition frame = (F32)elem[LLSettingsDay::SETTING_KEYKFRAME].asReal();
|
||||
if ((frame < 0.0) || (frame > 1.0))
|
||||
{
|
||||
frame = llclamp(frame, 0.0f, 1.0f);
|
||||
|
|
|
|||
|
|
@ -484,19 +484,19 @@ void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
|
|||
// If there is no cloud texture in destination, reduce coverage to imitate disappearance
|
||||
// See LLDrawPoolWLSky::renderSkyClouds... we don't blend present texture with null
|
||||
// Note: Probably can be done by shader
|
||||
cloud_shadow = lerp(mSettings[SETTING_CLOUD_SHADOW].asReal(), (F64)0.f, blendf);
|
||||
cloud_shadow = lerp((F32)mSettings[SETTING_CLOUD_SHADOW].asReal(), 0.f, (F32)blendf);
|
||||
cloud_noise_id_next = cloud_noise_id;
|
||||
}
|
||||
else if (cloud_noise_id.isNull() && !cloud_noise_id_next.isNull())
|
||||
{
|
||||
// Source has no cloud texture, reduce initial coverage to imitate appearance
|
||||
// use same texture as destination
|
||||
cloud_shadow = lerp((F64)0.f, other->mSettings[SETTING_CLOUD_SHADOW].asReal(), blendf);
|
||||
cloud_shadow = lerp(0.f, (F32)other->mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)blendf);
|
||||
setCloudNoiseTextureId(cloud_noise_id_next);
|
||||
}
|
||||
else
|
||||
{
|
||||
cloud_shadow = lerp(mSettings[SETTING_CLOUD_SHADOW].asReal(), other->mSettings[SETTING_CLOUD_SHADOW].asReal(), blendf);
|
||||
cloud_shadow = lerp((F32)mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)other->mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)blendf);
|
||||
}
|
||||
|
||||
LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, other->getParameterMap(), blendf);
|
||||
|
|
@ -927,8 +927,8 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
|
|||
if (legacy.has(SETTING_LEGACY_EAST_ANGLE) && legacy.has(SETTING_LEGACY_SUN_ANGLE))
|
||||
{
|
||||
// get counter-clockwise radian angle from clockwise legacy WL east angle...
|
||||
F32 azimuth = -legacy[SETTING_LEGACY_EAST_ANGLE].asReal();
|
||||
F32 altitude = legacy[SETTING_LEGACY_SUN_ANGLE].asReal();
|
||||
F32 azimuth = -(F32)legacy[SETTING_LEGACY_EAST_ANGLE].asReal();
|
||||
F32 altitude = (F32)legacy[SETTING_LEGACY_SUN_ANGLE].asReal();
|
||||
|
||||
LLQuaternion sunquat = convert_azimuth_and_altitude_to_quat(azimuth, altitude);
|
||||
// original WL moon dir was diametrically opposed to the sun dir
|
||||
|
|
@ -962,7 +962,7 @@ void LLSettingsSky::updateSettings()
|
|||
F32 LLSettingsSky::getSunMoonGlowFactor() const
|
||||
{
|
||||
return getIsSunUp() ? 1.0f :
|
||||
getIsMoonUp() ? getMoonBrightness() * 0.25 : 0.0f;
|
||||
getIsMoonUp() ? getMoonBrightness() * 0.25f : 0.0f;
|
||||
}
|
||||
|
||||
bool LLSettingsSky::getIsSunUp() const
|
||||
|
|
@ -1047,11 +1047,11 @@ F32 LLSettingsSky::getFloat(const std::string& key, F32 default_value) const
|
|||
LL_PROFILE_ZONE_SCOPED_CATEGORY_ENVIRONMENT;
|
||||
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(key))
|
||||
{
|
||||
return mSettings[SETTING_LEGACY_HAZE][key].asReal();
|
||||
return (F32)mSettings[SETTING_LEGACY_HAZE][key].asReal();
|
||||
}
|
||||
if (mSettings.has(key))
|
||||
{
|
||||
return mSettings[key].asReal();
|
||||
return (F32)mSettings[key].asReal();
|
||||
}
|
||||
return default_value;
|
||||
}
|
||||
|
|
@ -1311,7 +1311,7 @@ void LLSettingsSky::clampColor(LLColor3& color, F32 gamma, F32 scale) const
|
|||
color *= scale/max_color;
|
||||
}
|
||||
LLColor3 linear(color);
|
||||
linear *= 1.0 / scale;
|
||||
linear *= 1.0f / scale;
|
||||
linear = smear(1.0f) - linear;
|
||||
linear = componentPow(linear, gamma);
|
||||
linear *= scale;
|
||||
|
|
@ -1357,7 +1357,7 @@ void LLSettingsSky::calculateLightSettings() const
|
|||
|
||||
F32 haze_horizon = getHazeHorizon();
|
||||
|
||||
sunlight *= 1.0 - cloud_shadow;
|
||||
sunlight *= 1.0f - cloud_shadow;
|
||||
sunlight += tmpAmbient;
|
||||
|
||||
mHazeColor = getBlueHorizon() * getBlueDensity() * sunlight;
|
||||
|
|
@ -1419,22 +1419,22 @@ LLUUID LLSettingsSky::GetDefaultHaloTextureId()
|
|||
|
||||
F32 LLSettingsSky::getPlanetRadius() const
|
||||
{
|
||||
return mSettings[SETTING_PLANET_RADIUS].asReal();
|
||||
return (F32)mSettings[SETTING_PLANET_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyMoistureLevel() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal();
|
||||
return (F32)mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyDropletRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_DROPLET_RADIUS].asReal();
|
||||
return (F32)mSettings[SETTING_SKY_DROPLET_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyIceLevel() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_ICE_LEVEL].asReal();
|
||||
return (F32)mSettings[SETTING_SKY_ICE_LEVEL].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
|
||||
|
|
@ -1444,27 +1444,27 @@ F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
|
|||
return sAutoAdjustProbeAmbiance;
|
||||
}
|
||||
|
||||
return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
|
||||
return (F32)mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyBottomRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
|
||||
return (F32)mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSkyTopRadius() const
|
||||
{
|
||||
return mSettings[SETTING_SKY_TOP_RADIUS].asReal();
|
||||
return (F32)mSettings[SETTING_SKY_TOP_RADIUS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getSunArcRadians() const
|
||||
{
|
||||
return mSettings[SETTING_SUN_ARC_RADIANS].asReal();
|
||||
return (F32)mSettings[SETTING_SUN_ARC_RADIANS].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getMieAnisotropy() const
|
||||
{
|
||||
return getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR].asReal();
|
||||
return (F32)getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR].asReal();
|
||||
}
|
||||
|
||||
LLSD LLSettingsSky::getRayleighConfig() const
|
||||
|
|
@ -1573,7 +1573,7 @@ void LLSettingsSky::setCloudPosDensity2(const LLColor3 &val)
|
|||
|
||||
F32 LLSettingsSky::getCloudScale() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_SCALE].asReal();
|
||||
return (F32)mSettings[SETTING_CLOUD_SCALE].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudScale(F32 val)
|
||||
|
|
@ -1605,7 +1605,7 @@ void LLSettingsSky::setCloudScrollRateY(F32 val)
|
|||
|
||||
F32 LLSettingsSky::getCloudShadow() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_SHADOW].asReal();
|
||||
return (F32)mSettings[SETTING_CLOUD_SHADOW].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudShadow(F32 val)
|
||||
|
|
@ -1615,7 +1615,7 @@ void LLSettingsSky::setCloudShadow(F32 val)
|
|||
|
||||
F32 LLSettingsSky::getCloudVariance() const
|
||||
{
|
||||
return mSettings[SETTING_CLOUD_VARIANCE].asReal();
|
||||
return (F32)mSettings[SETTING_CLOUD_VARIANCE].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setCloudVariance(F32 val)
|
||||
|
|
@ -1625,7 +1625,7 @@ void LLSettingsSky::setCloudVariance(F32 val)
|
|||
|
||||
F32 LLSettingsSky::getDomeOffset() const
|
||||
{
|
||||
//return mSettings[SETTING_DOME_OFFSET].asReal();
|
||||
//return (F32)mSettings[SETTING_DOME_OFFSET].asReal();
|
||||
return DOME_OFFSET;
|
||||
}
|
||||
|
||||
|
|
@ -1637,7 +1637,7 @@ F32 LLSettingsSky::getDomeRadius() const
|
|||
|
||||
F32 LLSettingsSky::getGamma() const
|
||||
{
|
||||
return mSettings[SETTING_GAMMA].asReal();
|
||||
return (F32)mSettings[SETTING_GAMMA].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setGamma(F32 val)
|
||||
|
|
@ -1658,7 +1658,7 @@ void LLSettingsSky::setGlow(const LLColor3 &val)
|
|||
|
||||
F32 LLSettingsSky::getMaxY() const
|
||||
{
|
||||
return mSettings[SETTING_MAX_Y].asReal();
|
||||
return (F32)mSettings[SETTING_MAX_Y].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setMaxY(F32 val)
|
||||
|
|
@ -1678,7 +1678,7 @@ void LLSettingsSky::setMoonRotation(const LLQuaternion &val)
|
|||
|
||||
F32 LLSettingsSky::getMoonScale() const
|
||||
{
|
||||
return mSettings[SETTING_MOON_SCALE].asReal();
|
||||
return (F32)mSettings[SETTING_MOON_SCALE].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setMoonScale(F32 val)
|
||||
|
|
@ -1696,9 +1696,9 @@ void LLSettingsSky::setMoonTextureId(LLUUID id)
|
|||
setValue(SETTING_MOON_TEXTUREID, id);
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getMoonBrightness() const
|
||||
F32 LLSettingsSky::getMoonBrightness() const
|
||||
{
|
||||
return mSettings[SETTING_MOON_BRIGHTNESS].asReal();
|
||||
return (F32)mSettings[SETTING_MOON_BRIGHTNESS].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setMoonBrightness(F32 brightness_factor)
|
||||
|
|
@ -1708,7 +1708,7 @@ void LLSettingsSky::setMoonBrightness(F32 brightness_factor)
|
|||
|
||||
F32 LLSettingsSky::getStarBrightness() const
|
||||
{
|
||||
return mSettings[SETTING_STAR_BRIGHTNESS].asReal();
|
||||
return (F32)mSettings[SETTING_STAR_BRIGHTNESS].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setStarBrightness(F32 val)
|
||||
|
|
@ -1753,7 +1753,7 @@ void LLSettingsSky::setSunRotation(const LLQuaternion &val)
|
|||
|
||||
F32 LLSettingsSky::getSunScale() const
|
||||
{
|
||||
return mSettings[SETTING_SUN_SCALE].asReal();
|
||||
return (F32)mSettings[SETTING_SUN_SCALE].asReal();
|
||||
}
|
||||
|
||||
void LLSettingsSky::setSunScale(F32 val)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public:
|
|||
//---------------------------------------------------------------------
|
||||
F32 getBlurMultiplier() const
|
||||
{
|
||||
return mSettings[SETTING_BLUR_MULTIPLIER].asReal();
|
||||
return (F32)mSettings[SETTING_BLUR_MULTIPLIER].asReal();
|
||||
}
|
||||
|
||||
void setBlurMultiplier(F32 val)
|
||||
|
|
@ -92,7 +92,7 @@ public:
|
|||
|
||||
F32 getWaterFogDensity() const
|
||||
{
|
||||
return mSettings[SETTING_FOG_DENSITY].asReal();
|
||||
return (F32)mSettings[SETTING_FOG_DENSITY].asReal();
|
||||
}
|
||||
|
||||
F32 getModifiedWaterFogDensity(bool underwater) const;
|
||||
|
|
@ -104,7 +104,7 @@ public:
|
|||
|
||||
F32 getFogMod() const
|
||||
{
|
||||
return mSettings[SETTING_FOG_MOD].asReal();
|
||||
return (F32)mSettings[SETTING_FOG_MOD].asReal();
|
||||
}
|
||||
|
||||
void setFogMod(F32 val)
|
||||
|
|
@ -114,7 +114,7 @@ public:
|
|||
|
||||
F32 getFresnelOffset() const
|
||||
{
|
||||
return mSettings[SETTING_FRESNEL_OFFSET].asReal();
|
||||
return (F32)mSettings[SETTING_FRESNEL_OFFSET].asReal();
|
||||
}
|
||||
|
||||
void setFresnelOffset(F32 val)
|
||||
|
|
@ -124,7 +124,7 @@ public:
|
|||
|
||||
F32 getFresnelScale() const
|
||||
{
|
||||
return mSettings[SETTING_FRESNEL_SCALE].asReal();
|
||||
return (F32)mSettings[SETTING_FRESNEL_SCALE].asReal();
|
||||
}
|
||||
|
||||
void setFresnelScale(F32 val)
|
||||
|
|
@ -164,7 +164,7 @@ public:
|
|||
|
||||
F32 getScaleAbove() const
|
||||
{
|
||||
return mSettings[SETTING_SCALE_ABOVE].asReal();
|
||||
return (F32)mSettings[SETTING_SCALE_ABOVE].asReal();
|
||||
}
|
||||
|
||||
void setScaleAbove(F32 val)
|
||||
|
|
@ -174,7 +174,7 @@ public:
|
|||
|
||||
F32 getScaleBelow() const
|
||||
{
|
||||
return mSettings[SETTING_SCALE_BELOW].asReal();
|
||||
return (F32)mSettings[SETTING_SCALE_BELOW].asReal();
|
||||
}
|
||||
|
||||
void setScaleBelow(F32 val)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ LLPointer<LLInventoryItem> create_random_inventory_item()
|
|||
S32 price = rand();
|
||||
LLSaleInfo sale_info(LLSaleInfo::FS_COPY, price);
|
||||
U32 flags = rand();
|
||||
S32 creation = time(NULL);
|
||||
S32 creation = (S32)time(NULL);
|
||||
|
||||
LLPointer<LLInventoryItem> item = new LLInventoryItem(
|
||||
item_id,
|
||||
|
|
@ -195,7 +195,7 @@ namespace tut
|
|||
src->setSaleInfo(new_sale_info);
|
||||
|
||||
U32 new_flags = rand();
|
||||
S32 new_creation = time(NULL);
|
||||
S32 new_creation = (S32)time(NULL);
|
||||
|
||||
LLPermissions new_perm;
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ namespace tut
|
|||
src->setSaleInfo(new_sale_info);
|
||||
|
||||
U32 new_flags = rand();
|
||||
S32 new_creation = time(NULL);
|
||||
S32 new_creation = (S32)time(NULL);
|
||||
|
||||
LLPermissions new_perm;
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ private:
|
|||
F32 _exp(const F32& a) const { return exp(a); }
|
||||
F32 _fabs(const F32& a) const { return fabs(a); }
|
||||
F32 _floor(const F32& a) const { return (F32)llfloor(a); }
|
||||
F32 _ceil(const F32& a) const { return llceil(a); }
|
||||
F32 _ceil(const F32& a) const { return (F32)llceil(a); }
|
||||
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
|
||||
F32 _pow(const F32& a, const F32& b) const { return powf(a, b); }
|
||||
F32 _fmod(const F32&a, const F32& b) const { return fmodf(a, b); }
|
||||
|
|
|
|||
|
|
@ -186,10 +186,10 @@ inline LLSD LLQuaternion::getValue() const
|
|||
|
||||
inline void LLQuaternion::setValue(const LLSD& sd)
|
||||
{
|
||||
mQ[0] = sd[0].asReal();
|
||||
mQ[1] = sd[1].asReal();
|
||||
mQ[2] = sd[2].asReal();
|
||||
mQ[3] = sd[3].asReal();
|
||||
mQ[0] = (F32)sd[0].asReal();
|
||||
mQ[1] = (F32)sd[1].asReal();
|
||||
mQ[2] = (F32)sd[2].asReal();
|
||||
mQ[3] = (F32)sd[3].asReal();
|
||||
}
|
||||
|
||||
// checker
|
||||
|
|
|
|||
|
|
@ -519,9 +519,9 @@ inline const LLVector3 linearColor3v(const T& a) {
|
|||
template<typename T>
|
||||
const LLColor3& LLColor3::set(const std::vector<T>& v)
|
||||
{
|
||||
for (S32 i = 0; i < llmin((S32)v.size(), 3); ++i)
|
||||
for (size_t i = 0; i < llmin(v.size(), 3); ++i)
|
||||
{
|
||||
mV[i] = v[i];
|
||||
mV[i] = (F32)v[i];
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
@ -532,9 +532,9 @@ const LLColor3& LLColor3::set(const std::vector<T>& v)
|
|||
template<typename T>
|
||||
void LLColor3::write(std::vector<T>& v) const
|
||||
{
|
||||
for (int i = 0; i < llmin((S32)v.size(), 3); ++i)
|
||||
for (size_t i = 0; i < llmin(v.size(), 3); ++i)
|
||||
{
|
||||
v[i] = mV[i];
|
||||
v[i] = (T)mV[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -705,9 +705,9 @@ inline const LLColor4 linearColor4(const LLColor4 &a)
|
|||
template<typename T>
|
||||
const LLColor4& LLColor4::set(const std::vector<T>& v)
|
||||
{
|
||||
for (S32 i = 0; i < llmin((S32)v.size(), 4); ++i)
|
||||
for (size_t i = 0; i < llmin(v.size(), 4); ++i)
|
||||
{
|
||||
mV[i] = v[i];
|
||||
mV[i] = (F32)v[i];
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
@ -716,9 +716,9 @@ const LLColor4& LLColor4::set(const std::vector<T>& v)
|
|||
template<typename T>
|
||||
void LLColor4::write(std::vector<T>& v) const
|
||||
{
|
||||
for (int i = 0; i < llmin((S32)v.size(), 4); ++i)
|
||||
for (size_t i = 0; i < llmin(v.size(), 4); ++i)
|
||||
{
|
||||
v[i] = mV[i];
|
||||
v[i] = (T)mV[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ class LLVector4
|
|||
|
||||
void setValue(const LLSD& sd)
|
||||
{
|
||||
mV[0] = sd[0].asReal();
|
||||
mV[1] = sd[1].asReal();
|
||||
mV[2] = sd[2].asReal();
|
||||
mV[3] = sd[3].asReal();
|
||||
mV[0] = (F32)sd[0].asReal();
|
||||
mV[1] = (F32)sd[1].asReal();
|
||||
mV[2] = (F32)sd[2].asReal();
|
||||
mV[3] = (F32)sd[3].asReal();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ LLHeapBuffer::~LLHeapBuffer()
|
|||
|
||||
S32 LLHeapBuffer::bytesLeft() const
|
||||
{
|
||||
return (mSize - (mNextFree - mBuffer));
|
||||
return (mSize - (S32)(mNextFree - mBuffer));
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -371,11 +371,11 @@ LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
|
|||
return it;
|
||||
}
|
||||
S32 channel = (*it).getChannel();
|
||||
LLSegment segment1(channel, base, (address - base) + 1);
|
||||
LLSegment segment1(channel, base, (S32)((address - base) + 1));
|
||||
*it = segment1;
|
||||
segment_iterator_t rv = it;
|
||||
++it;
|
||||
LLSegment segment2(channel, address + 1, size - (address - base) - 1);
|
||||
LLSegment segment2(channel, address + 1, (S32)(size - (address - base) - 1));
|
||||
mSegments.insert(it, segment2);
|
||||
return rv;
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
|
|||
segment = LLSegment(
|
||||
(*rv).getChannel(),
|
||||
address,
|
||||
(*rv).size() - (address - (*rv).data()));
|
||||
(*rv).size() - (S32)(address - (*rv).data()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -533,7 +533,7 @@ S32 LLBufferArray::countAfter(S32 channel, U8* start) const
|
|||
if(++start < ((*it).data() + (*it).size()))
|
||||
{
|
||||
// it's in the same segment
|
||||
offset = start - (*it).data();
|
||||
offset = (S32)(start - (*it).data());
|
||||
}
|
||||
else if(++it == end)
|
||||
{
|
||||
|
|
@ -586,7 +586,7 @@ U8* LLBufferArray::readAfter(
|
|||
&& (*it).isOnChannel(channel))
|
||||
{
|
||||
// copy the data out of this segment
|
||||
S32 bytes_in_segment = (*it).size() - (start - (*it).data());
|
||||
S32 bytes_in_segment = (*it).size() - (S32)(start - (*it).data());
|
||||
bytes_to_copy = llmin(bytes_left, bytes_in_segment);
|
||||
memcpy(dest, start, bytes_to_copy); /*Flawfinder: ignore*/
|
||||
len += bytes_to_copy;
|
||||
|
|
@ -681,7 +681,7 @@ U8* LLBufferArray::seek(
|
|||
{
|
||||
if(delta > 0)
|
||||
{
|
||||
S32 bytes_in_segment = (*it).size() - (start - (*it).data());
|
||||
S32 bytes_in_segment = (*it).size() - (S32)(start - (*it).data());
|
||||
S32 local_delta = llmin(delta, bytes_in_segment);
|
||||
rv += local_delta;
|
||||
delta -= local_delta;
|
||||
|
|
@ -689,7 +689,7 @@ U8* LLBufferArray::seek(
|
|||
}
|
||||
else
|
||||
{
|
||||
S32 bytes_in_segment = start - (*it).data();
|
||||
S32 bytes_in_segment = (S32)(start - (*it).data());
|
||||
S32 local_delta = llmin(llabs(delta), bytes_in_segment);
|
||||
rv -= local_delta;
|
||||
delta += local_delta;
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ streampos LLBufferStreamBuf::seekoff(
|
|||
}
|
||||
|
||||
LLMutexLock lock(mBuffer->getMutex());
|
||||
address = mBuffer->seek(mChannels.in(), base_addr, off);
|
||||
address = mBuffer->seek(mChannels.in(), base_addr, (S32)off);
|
||||
if(address)
|
||||
{
|
||||
LLBufferArray::segment_iterator_t iter;
|
||||
|
|
@ -306,7 +306,7 @@ streampos LLBufferStreamBuf::seekoff(
|
|||
}
|
||||
|
||||
LLMutexLock lock(mBuffer->getMutex());
|
||||
address = mBuffer->seek(mChannels.out(), base_addr, off);
|
||||
address = mBuffer->seek(mChannels.out(), base_addr, (S32)off);
|
||||
if(address)
|
||||
{
|
||||
LLBufferArray::segment_iterator_t iter;
|
||||
|
|
|
|||
|
|
@ -531,13 +531,13 @@ void LLCircuitData::checkPeriodTime()
|
|||
F64Seconds period_length = mt_sec - mPeriodTime;
|
||||
if ( period_length > TARGET_PERIOD_LENGTH)
|
||||
{
|
||||
F32 bps_in = F32Bits(mBytesInThisPeriod).value() / period_length.value();
|
||||
F32 bps_in = F32Bits(mBytesInThisPeriod).value() / (F32)period_length.value();
|
||||
if (bps_in > mPeakBPSIn)
|
||||
{
|
||||
mPeakBPSIn = bps_in;
|
||||
}
|
||||
|
||||
F32 bps_out = F32Bits(mBytesOutThisPeriod).value() / period_length.value();
|
||||
F32 bps_out = F32Bits(mBytesOutThisPeriod).value() / (F32)period_length.value();
|
||||
if (bps_out > mPeakBPSOut)
|
||||
{
|
||||
mPeakBPSOut = bps_out;
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ bool LLHTTPResponder::readHeaderLine(
|
|||
}
|
||||
return false;
|
||||
}
|
||||
S32 offset = -((len - 1) - (newline - dest));
|
||||
S32 offset = -((len - 1) - (S32)(newline - dest));
|
||||
++newline;
|
||||
*newline = '\0';
|
||||
mLastRead = buffer->seek(channels.in(), last, offset);
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S
|
|||
{
|
||||
if (strcmp(COMMON_PROFILE_INPUT_POSITION, v_inp[k]->getSemantic()) == 0)
|
||||
{
|
||||
pos_offset = inputs[j]->getOffset();
|
||||
pos_offset = (S32)inputs[j]->getOffset();
|
||||
|
||||
const domURIFragmentType& uri = v_inp[k]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
|
|
@ -164,7 +164,7 @@ bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S
|
|||
|
||||
if (strcmp(COMMON_PROFILE_INPUT_NORMAL, v_inp[k]->getSemantic()) == 0)
|
||||
{
|
||||
norm_offset = inputs[j]->getOffset();
|
||||
norm_offset = (S32)inputs[j]->getOffset();
|
||||
|
||||
const domURIFragmentType& uri = v_inp[k]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
|
|
@ -176,14 +176,14 @@ bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S
|
|||
if (strcmp(COMMON_PROFILE_INPUT_NORMAL, inputs[j]->getSemantic()) == 0)
|
||||
{
|
||||
//found normal array for this triangle list
|
||||
norm_offset = inputs[j]->getOffset();
|
||||
norm_offset = (S32)inputs[j]->getOffset();
|
||||
const domURIFragmentType& uri = inputs[j]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
norm_source = (domSource*) elem.cast();
|
||||
}
|
||||
else if (strcmp(COMMON_PROFILE_INPUT_TEXCOORD, inputs[j]->getSemantic()) == 0)
|
||||
{ //found texCoords
|
||||
tc_offset = inputs[j]->getOffset();
|
||||
tc_offset = (S32)inputs[j]->getOffset();
|
||||
const domURIFragmentType& uri = inputs[j]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
tc_source = (domSource*) elem.cast();
|
||||
|
|
@ -249,8 +249,8 @@ LLModel::EModelStatus load_face_from_dom_triangles(
|
|||
return LLModel::BAD_ELEMENT;
|
||||
}
|
||||
// VFExtents change
|
||||
face.mExtents[0].set(v[0], v[1], v[2]);
|
||||
face.mExtents[1].set(v[0], v[1], v[2]);
|
||||
face.mExtents[0].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
face.mExtents[1].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
}
|
||||
|
||||
LLVolumeFace::VertexMapData::PointMap point_map;
|
||||
|
|
@ -271,22 +271,22 @@ LLModel::EModelStatus load_face_from_dom_triangles(
|
|||
LLVolumeFace::VertexData cv;
|
||||
if (pos_source)
|
||||
{
|
||||
cv.setPosition(LLVector4a(v[idx[i+pos_offset]*3+0],
|
||||
v[idx[i+pos_offset]*3+1],
|
||||
v[idx[i+pos_offset]*3+2]));
|
||||
cv.setPosition(LLVector4a((F32)v[idx[i+pos_offset]*3+0],
|
||||
(F32)v[idx[i+pos_offset]*3+1],
|
||||
(F32)v[idx[i+pos_offset]*3+2]));
|
||||
}
|
||||
|
||||
if (tc_source)
|
||||
{
|
||||
cv.mTexCoord.setVec(tc[idx[i+tc_offset]*2+0],
|
||||
tc[idx[i+tc_offset]*2+1]);
|
||||
cv.mTexCoord.setVec((F32)tc[idx[i+tc_offset]*2+0],
|
||||
(F32)tc[idx[i+tc_offset]*2+1]);
|
||||
}
|
||||
|
||||
if (norm_source)
|
||||
{
|
||||
cv.setNormal(LLVector4a(n[idx[i+norm_offset]*3+0],
|
||||
n[idx[i+norm_offset]*3+1],
|
||||
n[idx[i+norm_offset]*3+2]));
|
||||
cv.setNormal(LLVector4a((F32)n[idx[i+norm_offset]*3+0],
|
||||
(F32)n[idx[i+norm_offset]*3+1],
|
||||
(F32)n[idx[i+norm_offset]*3+2]));
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
|
|
@ -374,8 +374,8 @@ LLModel::EModelStatus load_face_from_dom_triangles(
|
|||
|
||||
face = LLVolumeFace();
|
||||
// VFExtents change
|
||||
face.mExtents[0].set(v[0], v[1], v[2]);
|
||||
face.mExtents[1].set(v[0], v[1], v[2]);
|
||||
face.mExtents[0].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
face.mExtents[1].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
|
||||
verts.clear();
|
||||
indices.clear();
|
||||
|
|
@ -464,8 +464,8 @@ LLModel::EModelStatus load_face_from_dom_polylist(
|
|||
{
|
||||
v = pos_source->getFloat_array()->getValue();
|
||||
// VFExtents change
|
||||
face.mExtents[0].set(v[0], v[1], v[2]);
|
||||
face.mExtents[1].set(v[0], v[1], v[2]);
|
||||
face.mExtents[0].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
face.mExtents[1].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
}
|
||||
|
||||
if (tc_source)
|
||||
|
|
@ -493,9 +493,9 @@ LLModel::EModelStatus load_face_from_dom_polylist(
|
|||
|
||||
if (pos_source)
|
||||
{
|
||||
cv.getPosition().set(v[idx[cur_idx+pos_offset]*3+0],
|
||||
v[idx[cur_idx+pos_offset]*3+1],
|
||||
v[idx[cur_idx+pos_offset]*3+2]);
|
||||
cv.getPosition().set((F32)v[idx[cur_idx+pos_offset]*3+0],
|
||||
(F32)v[idx[cur_idx+pos_offset]*3+1],
|
||||
(F32)v[idx[cur_idx+pos_offset]*3+2]);
|
||||
if (!cv.getPosition().isFinite3())
|
||||
{
|
||||
LL_WARNS() << "Found NaN while loading position data from DAE-Model, invalid model." << LL_ENDL;
|
||||
|
|
@ -513,7 +513,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(
|
|||
|
||||
if (idx_y < tc.getCount())
|
||||
{
|
||||
cv.mTexCoord.setVec(tc[idx_x], tc[idx_y]);
|
||||
cv.mTexCoord.setVec((F32)tc[idx_x], (F32)tc[idx_y]);
|
||||
}
|
||||
else if (log_tc_msg)
|
||||
{
|
||||
|
|
@ -527,9 +527,9 @@ LLModel::EModelStatus load_face_from_dom_polylist(
|
|||
|
||||
if (norm_source)
|
||||
{
|
||||
cv.getNormal().set(n[idx[cur_idx+norm_offset]*3+0],
|
||||
n[idx[cur_idx+norm_offset]*3+1],
|
||||
n[idx[cur_idx+norm_offset]*3+2]);
|
||||
cv.getNormal().set((F32)n[idx[cur_idx+norm_offset]*3+0],
|
||||
(F32)n[idx[cur_idx+norm_offset]*3+1],
|
||||
(F32)n[idx[cur_idx+norm_offset]*3+2]);
|
||||
|
||||
if (!cv.getNormal().isFinite3())
|
||||
{
|
||||
|
|
@ -655,8 +655,8 @@ LLModel::EModelStatus load_face_from_dom_polylist(
|
|||
|
||||
face = LLVolumeFace();
|
||||
// VFExtents change
|
||||
face.mExtents[0].set(v[0], v[1], v[2]);
|
||||
face.mExtents[1].set(v[0], v[1], v[2]);
|
||||
face.mExtents[0].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
face.mExtents[1].set((F32)v[0], (F32)v[1], (F32)v[2]);
|
||||
verts.clear();
|
||||
indices.clear();
|
||||
point_map.clear();
|
||||
|
|
@ -717,7 +717,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
|
||||
if (strcmp(COMMON_PROFILE_INPUT_VERTEX, inputs[i]->getSemantic()) == 0)
|
||||
{ //found vertex array
|
||||
v_offset = inputs[i]->getOffset();
|
||||
v_offset = (S32)inputs[i]->getOffset();
|
||||
|
||||
const domURIFragmentType& uri = inputs[i]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
|
|
@ -745,7 +745,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
}
|
||||
else if (strcmp(COMMON_PROFILE_INPUT_NORMAL, inputs[i]->getSemantic()) == 0)
|
||||
{
|
||||
n_offset = inputs[i]->getOffset();
|
||||
n_offset = (S32)inputs[i]->getOffset();
|
||||
//found normal array for this triangle list
|
||||
const domURIFragmentType& uri = inputs[i]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
|
|
@ -758,7 +758,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
}
|
||||
else if (strcmp(COMMON_PROFILE_INPUT_TEXCOORD, inputs[i]->getSemantic()) == 0 && inputs[i]->getSet() == 0)
|
||||
{ //found texCoords
|
||||
t_offset = inputs[i]->getOffset();
|
||||
t_offset = (S32)inputs[i]->getOffset();
|
||||
const domURIFragmentType& uri = inputs[i]->getSource();
|
||||
daeElementRef elem = uri.getElement();
|
||||
domSource* src = (domSource*) elem.cast();
|
||||
|
|
@ -793,11 +793,11 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
|
||||
if (v)
|
||||
{
|
||||
U32 v_idx = idx[j*stride+v_offset]*3;
|
||||
U32 v_idx = (U32)idx[j*stride+v_offset]*3;
|
||||
v_idx = llclamp(v_idx, (U32) 0, (U32) v->getCount());
|
||||
vert.getPosition().set(v->get(v_idx),
|
||||
v->get(v_idx+1),
|
||||
v->get(v_idx+2));
|
||||
vert.getPosition().set((F32)v->get(v_idx),
|
||||
(F32)v->get(v_idx+1),
|
||||
(F32)v->get(v_idx+2));
|
||||
}
|
||||
|
||||
//bounds check n and t lookups because some FBX to DAE converters
|
||||
|
|
@ -805,11 +805,11 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
//for a particular channel
|
||||
if (n && n->getCount() > 0)
|
||||
{
|
||||
U32 n_idx = idx[j*stride+n_offset]*3;
|
||||
U32 n_idx = (U32)idx[j*stride+n_offset]*3;
|
||||
n_idx = llclamp(n_idx, (U32) 0, (U32) n->getCount());
|
||||
vert.getNormal().set(n->get(n_idx),
|
||||
n->get(n_idx+1),
|
||||
n->get(n_idx+2));
|
||||
vert.getNormal().set((F32)n->get(n_idx),
|
||||
(F32)n->get(n_idx+1),
|
||||
(F32)n->get(n_idx+2));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -819,10 +819,10 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
|
|||
|
||||
if (t && t->getCount() > 0)
|
||||
{
|
||||
U32 t_idx = idx[j*stride+t_offset]*2;
|
||||
U32 t_idx = (U32)idx[j*stride+t_offset]*2;
|
||||
t_idx = llclamp(t_idx, (U32) 0, (U32) t->getCount());
|
||||
vert.mTexCoord.setVec(t->get(t_idx),
|
||||
t->get(t_idx+1));
|
||||
vert.mTexCoord.setVec((F32)t->get(t_idx),
|
||||
(F32)t->get(t_idx+1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1090,7 +1090,7 @@ bool LLDAELoader::OpenFile(const std::string& filename)
|
|||
|
||||
if (unit)
|
||||
{
|
||||
F32 meter = unit->getMeter();
|
||||
F32 meter = (F32)unit->getMeter();
|
||||
mTransform.mMatrix[0][0] = meter;
|
||||
mTransform.mMatrix[1][1] = meter;
|
||||
mTransform.mMatrix[2][2] = meter;
|
||||
|
|
@ -1305,7 +1305,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
|
|||
{
|
||||
for(int j = 0; j < 4; j++)
|
||||
{
|
||||
mat.mMatrix[i][j] = dom_value[i + j*4];
|
||||
mat.mMatrix[i][j] = (F32)dom_value[i + j*4];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1533,7 +1533,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
|
|||
{
|
||||
for(int j = 0; j < 4; j++)
|
||||
{
|
||||
mat.mMatrix[i][j] = transform[k*16 + i + j*4];
|
||||
mat.mMatrix[i][j] = (F32)transform[k*16 + i + j*4];
|
||||
}
|
||||
}
|
||||
model->mSkinInfo.mInvBindMatrix.push_back(LLMatrix4a(mat));
|
||||
|
|
@ -1661,7 +1661,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
|
|||
LL_ERRS() << "Invalid position array size." << LL_ENDL;
|
||||
}
|
||||
|
||||
LLVector3 v(pos[j], pos[j+1], pos[j+2]);
|
||||
LLVector3 v((F32)pos[j], (F32)pos[j+1], (F32)pos[j+2]);
|
||||
|
||||
//transform from COLLADA space to volume space
|
||||
v = v * inverse_normalized_transformation;
|
||||
|
|
@ -1701,15 +1701,15 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
|
|||
U32 c_idx = 0;
|
||||
for (size_t vc_idx = 0; vc_idx < vcount.getCount(); ++vc_idx)
|
||||
{ //for each vertex
|
||||
daeUInt count = vcount[vc_idx];
|
||||
daeUInt count = (daeUInt)vcount[vc_idx];
|
||||
|
||||
//create list of weights that influence this vertex
|
||||
LLModel::weight_list weight_list;
|
||||
|
||||
for (daeUInt i = 0; i < count; ++i)
|
||||
{ //for each weight
|
||||
daeInt joint_idx = v[c_idx++];
|
||||
daeInt weight_idx = v[c_idx++];
|
||||
daeInt joint_idx = (daeInt)v[c_idx++];
|
||||
daeInt weight_idx = (daeInt)v[c_idx++];
|
||||
|
||||
if (joint_idx == -1)
|
||||
{
|
||||
|
|
@ -1717,7 +1717,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
|
|||
continue;
|
||||
}
|
||||
|
||||
F32 weight_value = w[weight_idx];
|
||||
F32 weight_value = (F32)w[weight_idx];
|
||||
|
||||
weight_list.push_back(LLModel::JointWeight(joint_idx, weight_value));
|
||||
}
|
||||
|
|
@ -1887,7 +1887,7 @@ bool LLDAELoader::verifyController( domController* pController )
|
|||
{
|
||||
//Skin is reference directly by geometry and get the vertex count from skin
|
||||
domSkin::domVertex_weights* pVertexWeights = pSkin->getVertex_weights();
|
||||
U32 vertexWeightsCount = pVertexWeights->getCount();
|
||||
U32 vertexWeightsCount = (U32)pVertexWeights->getCount();
|
||||
domGeometry* pGeometry = (domGeometry*) (domElement*) uri.getElement();
|
||||
domMesh* pMesh = pGeometry->getMesh();
|
||||
|
||||
|
|
@ -1905,7 +1905,7 @@ bool LLDAELoader::verifyController( domController* pController )
|
|||
{
|
||||
xsAnyURI src = pVertices->getInput_array()[0]->getSource();
|
||||
domSource* pSource = (domSource*) (domElement*) src.getElement();
|
||||
U32 verticesCount = pSource->getTechnique_common()->getAccessor()->getCount();
|
||||
U32 verticesCount = (U32)pSource->getTechnique_common()->getAccessor()->getCount();
|
||||
result = verifyCount( verticesCount, vertexWeightsCount );
|
||||
if ( !result )
|
||||
{
|
||||
|
|
@ -1925,7 +1925,7 @@ bool LLDAELoader::verifyController( domController* pController )
|
|||
U32 sum = 0;
|
||||
for (size_t i=0; i<vcountCount; i++)
|
||||
{
|
||||
sum += pVertexWeights->getVcount()->getValue()[i];
|
||||
sum += (U32)pVertexWeights->getVcount()->getValue()[i];
|
||||
}
|
||||
result = verifyCount( sum * static_cast<U32>(inputs.getCount()), (domInt) static_cast<int>(pVertexWeights->getV()->getValue().getCount()) );
|
||||
}
|
||||
|
|
@ -1940,7 +1940,7 @@ bool LLDAELoader::verifyController( domController* pController )
|
|||
void LLDAELoader::extractTranslation( domTranslate* pTranslate, LLMatrix4& transform )
|
||||
{
|
||||
domFloat3 jointTrans = pTranslate->getValue();
|
||||
LLVector3 singleJointTranslation( jointTrans[0], jointTrans[1], jointTrans[2] );
|
||||
LLVector3 singleJointTranslation((F32)jointTrans[0], (F32)jointTrans[1], (F32)jointTrans[2]);
|
||||
transform.setTranslation( singleJointTranslation );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1952,7 +1952,7 @@ void LLDAELoader::extractTranslationViaElement( daeElement* pTranslateElement, L
|
|||
{
|
||||
domTranslate* pTranslateChild = static_cast<domTranslate*>( pTranslateElement );
|
||||
domFloat3 translateChild = pTranslateChild->getValue();
|
||||
LLVector3 singleJointTranslation( translateChild[0], translateChild[1], translateChild[2] );
|
||||
LLVector3 singleJointTranslation((F32)translateChild[0], (F32)translateChild[1], (F32)translateChild[2]);
|
||||
transform.setTranslation( singleJointTranslation );
|
||||
}
|
||||
}
|
||||
|
|
@ -1974,7 +1974,7 @@ void LLDAELoader::extractTranslationViaSID( daeElement* pElement, LLMatrix4& tra
|
|||
{
|
||||
for( int j = 0; j < 4; j++ )
|
||||
{
|
||||
workingTransform.mMatrix[i][j] = domArray[i + j*4];
|
||||
workingTransform.mMatrix[i][j] = (F32)domArray[i + j*4];
|
||||
}
|
||||
}
|
||||
LLVector3 trans = workingTransform.getTranslation();
|
||||
|
|
@ -2037,7 +2037,7 @@ void LLDAELoader::processJointNode( domNode* pNode, JointTransformMap& jointTran
|
|||
{
|
||||
for (int j = 0; j < 4; j++)
|
||||
{
|
||||
workingTransform.mMatrix[i][j] = domArray[i + j * 4];
|
||||
workingTransform.mMatrix[i][j] = (F32)domArray[i + j * 4];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2103,7 +2103,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
domFloat3 dom_value = translate->getValue();
|
||||
|
||||
LLMatrix4 translation;
|
||||
translation.setTranslation(LLVector3(dom_value[0], dom_value[1], dom_value[2]));
|
||||
translation.setTranslation(LLVector3((F32)dom_value[0], (F32)dom_value[1], (F32)dom_value[2]));
|
||||
|
||||
translation *= mTransform;
|
||||
mTransform = translation;
|
||||
|
|
@ -2116,7 +2116,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
domFloat4 dom_value = rotate->getValue();
|
||||
|
||||
LLMatrix4 rotation;
|
||||
rotation.initRotTrans(dom_value[3] * DEG_TO_RAD, LLVector3(dom_value[0], dom_value[1], dom_value[2]), LLVector3(0, 0, 0));
|
||||
rotation.initRotTrans((F32)dom_value[3] * DEG_TO_RAD, LLVector3((F32)dom_value[0], (F32)dom_value[1], (F32)dom_value[2]), LLVector3(0, 0, 0));
|
||||
|
||||
rotation *= mTransform;
|
||||
mTransform = rotation;
|
||||
|
|
@ -2129,7 +2129,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
domFloat3 dom_value = scale->getValue();
|
||||
|
||||
|
||||
LLVector3 scale_vector = LLVector3(dom_value[0], dom_value[1], dom_value[2]);
|
||||
LLVector3 scale_vector = LLVector3((F32)dom_value[0], (F32)dom_value[1], (F32)dom_value[2]);
|
||||
scale_vector.abs(); // Set all values positive, since we don't currently support mirrored meshes
|
||||
LLMatrix4 scaling;
|
||||
scaling.initScale(scale_vector);
|
||||
|
|
@ -2150,7 +2150,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
|
|||
{
|
||||
for(int j = 0; j < 4; j++)
|
||||
{
|
||||
matrix_transform.mMatrix[i][j] = dom_value[i + j*4];
|
||||
matrix_transform.mMatrix[i][j] = (F32)dom_value[i + j*4];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2427,7 +2427,7 @@ LLImportMaterial LLDAELoader::profileToMaterial(domProfile_COMMON* material, DAE
|
|||
if (color)
|
||||
{
|
||||
domFx_color_common domfx_color = color->getValue();
|
||||
LLColor4 value = LLColor4(domfx_color[0], domfx_color[1], domfx_color[2], domfx_color[3]);
|
||||
LLColor4 value = LLColor4((F32)domfx_color[0], (F32)domfx_color[1], (F32)domfx_color[2], (F32)domfx_color[3]);
|
||||
mat.mDiffuseColor = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -2548,7 +2548,7 @@ LLColor4 LLDAELoader::getDaeColor(daeElement* element)
|
|||
if (color)
|
||||
{
|
||||
domFx_color_common domfx_color = color->getValue();
|
||||
value = LLColor4(domfx_color[0], domfx_color[1], domfx_color[2], domfx_color[3]);
|
||||
value = LLColor4((F32)domfx_color[0], (F32)domfx_color[1], (F32)domfx_color[2], (F32)domfx_color[3]);
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
|
|||
const LLSD& mf = data["mf"];
|
||||
if (mf.isReal())
|
||||
{
|
||||
mMetallicFactor = mf.asReal();
|
||||
mMetallicFactor = (F32)mf.asReal();
|
||||
if (mMetallicFactor == getDefaultMetallicFactor())
|
||||
{
|
||||
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
|
||||
|
|
@ -801,7 +801,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
|
|||
const LLSD& rf = data["rf"];
|
||||
if (rf.isReal())
|
||||
{
|
||||
mRoughnessFactor = rf.asReal();
|
||||
mRoughnessFactor = (F32)rf.asReal();
|
||||
if (mRoughnessFactor == getDefaultRoughnessFactor())
|
||||
{
|
||||
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
|
||||
|
|
@ -819,7 +819,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
|
|||
const LLSD& ac = data["ac"];
|
||||
if (ac.isReal())
|
||||
{
|
||||
mAlphaCutoff = ac.asReal();
|
||||
mAlphaCutoff = (F32)ac.asReal();
|
||||
if (mAlphaCutoff == getDefaultAlphaCutoff())
|
||||
{
|
||||
// HACK -- nudge by epsilon if we receive a default value (indicates override to default)
|
||||
|
|
@ -854,7 +854,7 @@ void LLGLTFMaterial::applyOverrideLLSD(const LLSD& data)
|
|||
const LLSD& r = ti[i]["r"];
|
||||
if (r.isReal())
|
||||
{
|
||||
mTextureTransform[i].mRotation = r.asReal();
|
||||
mTextureTransform[i].mRotation = (F32)r.asReal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1517,7 +1517,7 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin)
|
|||
{
|
||||
for (U32 k = 0; k < 4; k++)
|
||||
{
|
||||
mat.mMatrix[j][k] = skin["inverse_bind_matrix"][i][j*4+k].asReal();
|
||||
mat.mMatrix[j][k] = (F32)skin["inverse_bind_matrix"][i][j*4+k].asReal();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1540,7 +1540,7 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin)
|
|||
{
|
||||
for (U32 k = 0; k < 4; k++)
|
||||
{
|
||||
mat.mMatrix[j][k] = skin["bind_shape_matrix"][j*4+k].asReal();
|
||||
mat.mMatrix[j][k] = (F32)skin["bind_shape_matrix"][j*4+k].asReal();
|
||||
}
|
||||
}
|
||||
mBindShapeMatrix.loadu(mat);
|
||||
|
|
@ -1555,7 +1555,7 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin)
|
|||
{
|
||||
for (U32 k = 0; k < 4; k++)
|
||||
{
|
||||
mat.mMatrix[j][k] = skin["alt_inverse_bind_matrix"][i][j*4+k].asReal();
|
||||
mat.mMatrix[j][k] = (F32)skin["alt_inverse_bind_matrix"][i][j*4+k].asReal();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1565,7 +1565,7 @@ void LLMeshSkinInfo::fromLLSD(LLSD& skin)
|
|||
|
||||
if (skin.has("pelvis_offset"))
|
||||
{
|
||||
mPelvisOffset = skin["pelvis_offset"].asReal();
|
||||
mPelvisOffset = (F32)skin["pelvis_offset"].asReal();
|
||||
}
|
||||
|
||||
if (skin.has("lock_scale_if_joint_position"))
|
||||
|
|
@ -1653,7 +1653,7 @@ void LLMeshSkinInfo::updateHash()
|
|||
|
||||
for (size_t i = 0, count = mInvBindMatrix.size() * 16; i < count; ++i)
|
||||
{
|
||||
S32 t = llround(src[i] * 10000.f);
|
||||
S32 t = ll_round(src[i] * 10000.f);
|
||||
hash.update((const void*)&t, sizeof(S32));
|
||||
}
|
||||
//hash.update((const void*)mInvBindMatrix.data(), sizeof(LLMatrix4a) * mInvBindMatrix.size());
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ F32 LLTreeParams::ShapeRatio(EShapeRatio shape, F32 ratio)
|
|||
case (SR_SPHERICAL):
|
||||
return (.2f + .8f * sinf(F_PI*ratio));
|
||||
case (SR_HEMISPHERICAL):
|
||||
return (.2f + .8f * sinf(.5*F_PI*ratio));
|
||||
return (.2f + .8f * sinf(.5f*F_PI*ratio));
|
||||
case (SR_CYLINDRICAL):
|
||||
return (1);
|
||||
case (SR_TAPERED_CYLINDRICAL):
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ unsigned long ft_read_cb(FT_Stream stream, unsigned long offset, unsigned char *
|
|||
llifstream *file_stream = static_cast<llifstream *>(stream->descriptor.pointer);
|
||||
file_stream->seekg(offset, std::ios::beg);
|
||||
file_stream->read((char*)buffer, count);
|
||||
return file_stream->gcount();
|
||||
return (unsigned long)file_stream->gcount();
|
||||
}
|
||||
|
||||
void ft_close_cb(FT_Stream stream) {
|
||||
|
|
|
|||
|
|
@ -136,18 +136,18 @@ FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot,
|
|||
float svg_scale = llmin(svg_x_scale, svg_y_scale);
|
||||
datap->Scale = svg_scale;
|
||||
|
||||
glyph_slot->bitmap.width = floorf(svg_width) * svg_scale;
|
||||
glyph_slot->bitmap.rows = floorf(svg_height) * svg_scale;
|
||||
glyph_slot->bitmap.width = (unsigned int)(floorf(svg_width) * svg_scale);
|
||||
glyph_slot->bitmap.rows = (unsigned int)(floorf(svg_height) * svg_scale);
|
||||
glyph_slot->bitmap_left = (document->metrics.x_ppem - glyph_slot->bitmap.width) / 2;
|
||||
glyph_slot->bitmap_top = glyph_slot->face->size->metrics.ascender / 64.f;
|
||||
glyph_slot->bitmap_top = (FT_Int)(glyph_slot->face->size->metrics.ascender / 64.f);
|
||||
glyph_slot->bitmap.pitch = glyph_slot->bitmap.width * 4;
|
||||
glyph_slot->bitmap.pixel_mode = FT_PIXEL_MODE_BGRA;
|
||||
|
||||
/* Copied as-is from fcft (MIT license) */
|
||||
|
||||
// Compute all the bearings and set them correctly. The outline is scaled already, we just need to use the bounding box.
|
||||
float horiBearingX = 0.;
|
||||
float horiBearingY = -glyph_slot->bitmap_top;
|
||||
float horiBearingX = 0.f;
|
||||
float horiBearingY = -(float)glyph_slot->bitmap_top;
|
||||
|
||||
// XXX parentheses correct?
|
||||
float vertBearingX = glyph_slot->metrics.horiBearingX / 64.0f - glyph_slot->metrics.horiAdvance / 64.0f / 2;
|
||||
|
|
@ -156,13 +156,13 @@ FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot,
|
|||
// Do conversion in two steps to avoid 'bad function cast' warning
|
||||
glyph_slot->metrics.width = glyph_slot->bitmap.width * 64;
|
||||
glyph_slot->metrics.height = glyph_slot->bitmap.rows * 64;
|
||||
glyph_slot->metrics.horiBearingX = horiBearingX * 64;
|
||||
glyph_slot->metrics.horiBearingY = horiBearingY * 64;
|
||||
glyph_slot->metrics.vertBearingX = vertBearingX * 64;
|
||||
glyph_slot->metrics.vertBearingY = vertBearingY * 64;
|
||||
glyph_slot->metrics.horiBearingX = (FT_Pos)(horiBearingX * 64);
|
||||
glyph_slot->metrics.horiBearingY = (FT_Pos)(horiBearingY * 64);
|
||||
glyph_slot->metrics.vertBearingX = (FT_Pos)(vertBearingX * 64);
|
||||
glyph_slot->metrics.vertBearingY = (FT_Pos)(vertBearingY * 64);
|
||||
if (glyph_slot->metrics.vertAdvance == 0)
|
||||
{
|
||||
glyph_slot->metrics.vertAdvance = glyph_slot->bitmap.rows * 1.2f * 64;
|
||||
glyph_slot->metrics.vertAdvance = (FT_Pos)(glyph_slot->bitmap.rows * 1.2f * 64);
|
||||
}
|
||||
|
||||
return FT_Err_Ok;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ S32 LLFontGL::getNumFaces(const std::string& filename)
|
|||
S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style,
|
||||
ShadowType shadow, S32 max_chars, F32* right_x, bool use_ellipses, bool use_color) const
|
||||
{
|
||||
LLRectf rect_float(rect.mLeft, rect.mTop, rect.mRight, rect.mBottom);
|
||||
LLRectf rect_float((F32)rect.mLeft, (F32)rect.mTop, (F32)rect.mRight, (F32)rect.mBottom);
|
||||
return render(wstr, begin_offset, rect_float, color, halign, valign, style, shadow, max_chars, right_x, use_ellipses, use_color);
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRectf& rec
|
|||
y = rect.mBottom;
|
||||
break;
|
||||
}
|
||||
return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses, use_color);
|
||||
return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, (S32)rect.getWidth(), right_x, use_ellipses, use_color);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
|
|||
// *HACK: Fallback fonts don't render, so we can use that to suppress
|
||||
// creation of OpenGL textures for test apps. JC
|
||||
bool is_fallback = !is_first_found || !mCreateGLTextures;
|
||||
F32 extra_scale = (is_fallback)?fallback_scale:1.0;
|
||||
F32 extra_scale = (is_fallback) ? fallback_scale : 1.0f;
|
||||
F32 point_size_scale = extra_scale * point_size;
|
||||
bool is_font_loaded = false;
|
||||
for(string_vec_t::iterator font_search_path_it = font_search_paths.begin();
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ void LLGLSLShader::dumpStats()
|
|||
tris_sec /= seconds;
|
||||
|
||||
F32 pct_samples = (F32)((F64)mSamplesDrawn / (F64)sTotalSamplesDrawn) * 100.f;
|
||||
F32 samples_sec = (F32)mSamplesDrawn / 1000000000.0;
|
||||
F32 samples_sec = (F32)(mSamplesDrawn / 1000000000.0);
|
||||
samples_sec /= seconds;
|
||||
|
||||
F32 pct_binds = (F32)mBinds / (F32)sTotalBinds * 100.f;
|
||||
|
|
@ -1265,7 +1265,7 @@ void LLGLSLShader::uniform1i(U32 index, GLint x)
|
|||
if (iter == mValue.end() || iter->second.mV[0] != x)
|
||||
{
|
||||
glUniform1i(mUniform[index], x);
|
||||
mValue[mUniform[index]] = LLVector4(x, 0.f, 0.f, 0.f);
|
||||
mValue[mUniform[index]] = LLVector4((F32)x, 0.f, 0.f, 0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1405,7 +1405,7 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v)
|
|||
if (mUniform[index] >= 0)
|
||||
{
|
||||
const auto& iter = mValue.find(mUniform[index]);
|
||||
LLVector4 vec(v[0], 0.f, 0.f, 0.f);
|
||||
LLVector4 vec((F32)v[0], 0.f, 0.f, 0.f);
|
||||
if (iter == mValue.end() || shouldChange(iter->second, vec) || count != 1)
|
||||
{
|
||||
glUniform1iv(mUniform[index], count, v);
|
||||
|
|
@ -1432,7 +1432,7 @@ void LLGLSLShader::uniform4iv(U32 index, U32 count, const GLint* v)
|
|||
if (mUniform[index] >= 0)
|
||||
{
|
||||
const auto& iter = mValue.find(mUniform[index]);
|
||||
LLVector4 vec(v[0], v[1], v[2], v[3]);
|
||||
LLVector4 vec((F32)v[0], (F32)v[1], (F32)v[2], (F32)v[3]);
|
||||
if (iter == mValue.end() || shouldChange(iter->second, vec) || count != 1)
|
||||
{
|
||||
glUniform1iv(mUniform[index], count, v);
|
||||
|
|
@ -1702,7 +1702,7 @@ void LLGLSLShader::uniform1i(const LLStaticHashedString& uniform, GLint v)
|
|||
if (location >= 0)
|
||||
{
|
||||
const auto& iter = mValue.find(location);
|
||||
LLVector4 vec(v, 0.f, 0.f, 0.f);
|
||||
LLVector4 vec((F32)v, 0.f, 0.f, 0.f);
|
||||
if (iter == mValue.end() || shouldChange(iter->second, vec))
|
||||
{
|
||||
glUniform1i(location, v);
|
||||
|
|
@ -1718,7 +1718,7 @@ void LLGLSLShader::uniform1iv(const LLStaticHashedString& uniform, U32 count, co
|
|||
|
||||
if (location >= 0)
|
||||
{
|
||||
LLVector4 vec(v[0], 0, 0, 0);
|
||||
LLVector4 vec((F32)v[0], 0.f, 0.f, 0.f);
|
||||
const auto& iter = mValue.find(location);
|
||||
if (iter == mValue.end() || shouldChange(iter->second, vec) || count != 1)
|
||||
{
|
||||
|
|
@ -1736,7 +1736,7 @@ void LLGLSLShader::uniform4iv(const LLStaticHashedString& uniform, U32 count, co
|
|||
|
||||
if (location >= 0)
|
||||
{
|
||||
LLVector4 vec(v[0], v[1], v[2], v[3]);
|
||||
LLVector4 vec((F32)v[0], (F32)v[1], (F32)v[2], (F32)v[3]);
|
||||
const auto& iter = mValue.find(location);
|
||||
if (iter == mValue.end() || shouldChange(iter->second, vec) || count != 1)
|
||||
{
|
||||
|
|
@ -1755,7 +1755,7 @@ void LLGLSLShader::uniform2i(const LLStaticHashedString& uniform, GLint i, GLint
|
|||
if (location >= 0)
|
||||
{
|
||||
const auto& iter = mValue.find(location);
|
||||
LLVector4 vec(i, j, 0.f, 0.f);
|
||||
LLVector4 vec((F32)i, (F32)j, 0.f, 0.f);
|
||||
if (iter == mValue.end() || shouldChange(iter->second, vec))
|
||||
{
|
||||
glUniform2i(location, i, j);
|
||||
|
|
|
|||
|
|
@ -738,7 +738,7 @@ bool LLImageGL::setImage(const U8* data_in, bool data_hasmips /* = false */, S32
|
|||
}
|
||||
if (is_compressed)
|
||||
{
|
||||
S32 tex_size = dataFormatBytes(mFormatPrimary, w, h);
|
||||
GLsizei tex_size = (GLsizei)dataFormatBytes(mFormatPrimary, w, h);
|
||||
glCompressedTexImage2D(mTarget, gl_level, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in);
|
||||
stop_glerror();
|
||||
}
|
||||
|
|
@ -941,7 +941,7 @@ bool LLImageGL::setImage(const U8* data_in, bool data_hasmips /* = false */, S32
|
|||
S32 h = getHeight();
|
||||
if (is_compressed)
|
||||
{
|
||||
S32 tex_size = dataFormatBytes(mFormatPrimary, w, h);
|
||||
GLsizei tex_size = (GLsizei)dataFormatBytes(mFormatPrimary, w, h);
|
||||
glCompressedTexImage2D(mTarget, 0, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in);
|
||||
stop_glerror();
|
||||
}
|
||||
|
|
@ -2421,7 +2421,7 @@ bool LLImageGL::scaleDown(S32 desired_discard)
|
|||
if (size > sScratchPBOSize)
|
||||
{
|
||||
glBufferData(GL_PIXEL_PACK_BUFFER, size, NULL, GL_STREAM_COPY);
|
||||
sScratchPBOSize = size;
|
||||
sScratchPBOSize = (U32)size;
|
||||
}
|
||||
|
||||
glGetTexImage(mTarget, mip, mFormatPrimary, mFormatType, nullptr);
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ void LLPostProcess::viewOrthogonal(unsigned int width, unsigned int height)
|
|||
gGL.matrixMode(LLRender::MM_PROJECTION);
|
||||
gGL.pushMatrix();
|
||||
gGL.loadIdentity();
|
||||
gGL.ortho( 0.f, (GLdouble) width , (GLdouble) height , 0.f, -1.f, 1.f );
|
||||
gGL.ortho( 0.f, (GLfloat) width , (GLfloat) height , 0.f, -1.f, 1.f );
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.pushMatrix();
|
||||
gGL.loadIdentity();
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
|
|||
{
|
||||
// add in offset of current image to current UI translation
|
||||
const LLVector3 ui_scale = gGL.getUIScale();
|
||||
const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3(x, y, 0.f)).scaledVec(ui_scale);
|
||||
const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3((F32)x, (F32)y, 0.f)).scaledVec(ui_scale);
|
||||
|
||||
F32 uv_width = uv_outer_rect.getWidth();
|
||||
F32 uv_height = uv_outer_rect.getHeight();
|
||||
|
|
@ -421,8 +421,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
|
|||
uv_outer_rect.mLeft + (center_rect.mRight * uv_width),
|
||||
uv_outer_rect.mBottom + (center_rect.mBottom * uv_height));
|
||||
|
||||
F32 image_width = image->getWidth(0);
|
||||
F32 image_height = image->getHeight(0);
|
||||
F32 image_width = (F32)image->getWidth(0);
|
||||
F32 image_height = (F32)image->getHeight(0);
|
||||
|
||||
S32 image_natural_width = ll_round(image_width * uv_width);
|
||||
S32 image_natural_height = ll_round(image_height * uv_height);
|
||||
|
|
@ -459,10 +459,10 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
|
|||
draw_center_rect.setCenterAndSize(uv_center_rect.getCenterX() * width, uv_center_rect.getCenterY() * height, scaled_width, scaled_height);
|
||||
}
|
||||
|
||||
draw_center_rect.mLeft = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
|
||||
draw_center_rect.mTop = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
|
||||
draw_center_rect.mRight = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
|
||||
draw_center_rect.mBottom = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
|
||||
draw_center_rect.mLeft = (F32)ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
|
||||
draw_center_rect.mTop = (F32)ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
|
||||
draw_center_rect.mRight = (F32)ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
|
||||
draw_center_rect.mBottom = (F32)ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
|
||||
|
||||
LLRectf draw_outer_rect(ui_translation.mV[VX],
|
||||
ui_translation.mV[VY] + height * ui_scale.mV[VY],
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ void check_framebuffer_status()
|
|||
}
|
||||
}
|
||||
|
||||
bool LLRenderTarget::sInitFailed = false;
|
||||
bool LLRenderTarget::sUseFBO = false;
|
||||
U32 LLRenderTarget::sCurFBO = 0;
|
||||
|
||||
|
|
@ -124,7 +123,7 @@ bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, LLT
|
|||
|
||||
if (mGenerateMipMaps != LLTexUnit::TMG_NONE) {
|
||||
// Calculate the number of mip levels based upon resolution that we should have.
|
||||
mMipLevels = 1 + floor(log10((float)llmax(mResX, mResY))/log10(2.0));
|
||||
mMipLevels = 1 + (U32)floor(log10((float)llmax(mResX, mResY)) / log10(2.0));
|
||||
}
|
||||
|
||||
if (depth)
|
||||
|
|
@ -353,9 +352,6 @@ void LLRenderTarget::release()
|
|||
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
|
||||
llassert(!isBoundInStack());
|
||||
|
||||
if (sInitFailed)
|
||||
return;
|
||||
|
||||
if (mDepth)
|
||||
{
|
||||
LLImageGL::deleteTextures(1, &mDepth);
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@
|
|||
class LLRenderTarget
|
||||
{
|
||||
public:
|
||||
// Whether app initialization failed
|
||||
static bool sInitFailed;
|
||||
// Whether or not to use FBO implementation
|
||||
static bool sUseFBO;
|
||||
static U32 sBytesAllocated;
|
||||
|
|
|
|||
|
|
@ -1009,7 +1009,7 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version,
|
|||
ProgramBinaryData binary_info = ProgramBinaryData();
|
||||
binary_info.mBinaryFormat = data_pair.second["binary_format"].asInteger();
|
||||
binary_info.mBinaryLength = data_pair.second["binary_size"].asInteger();
|
||||
binary_info.mLastUsedTime = data_pair.second["last_used"].asReal();
|
||||
binary_info.mLastUsedTime = (F32)data_pair.second["last_used"].asReal();
|
||||
mShaderBinaryCache.insert_or_assign(LLUUID(data_pair.first), binary_info);
|
||||
}
|
||||
}
|
||||
|
|
@ -1040,7 +1040,7 @@ void LLShaderMgr::persistShaderCacheMetadata()
|
|||
LLSD out = LLSD::emptyMap();
|
||||
|
||||
static const F32 LRU_TIME = (60.f * 60.f) * 24.f * 7.f; // 14 days
|
||||
const F32 current_time = LLTimer::getTotalSeconds();
|
||||
const F32 current_time = (F32)LLTimer::getTotalSeconds();
|
||||
for (auto it = mShaderBinaryCache.begin(); it != mShaderBinaryCache.end();)
|
||||
{
|
||||
const ProgramBinaryData& shader_metadata = it->second;
|
||||
|
|
@ -1099,7 +1099,7 @@ bool LLShaderMgr::loadCachedProgramBinary(LLGLSLShader* shader)
|
|||
glGetProgramiv(shader->mProgramObject, GL_LINK_STATUS, &success);
|
||||
if (error == GL_NO_ERROR && success == GL_TRUE)
|
||||
{
|
||||
binary_iter->second.mLastUsedTime = LLTimer::getTotalSeconds();
|
||||
binary_iter->second.mLastUsedTime = (F32)LLTimer::getTotalSeconds();
|
||||
LL_INFOS() << "Loaded cached binary for shader: " << shader->mName << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1137,7 +1137,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader)
|
|||
fwrite(program_binary.data(), sizeof(U8), program_binary.size(), outfile);
|
||||
outfile.close();
|
||||
|
||||
binary_info.mLastUsedTime = LLTimer::getTotalSeconds();
|
||||
binary_info.mLastUsedTime = (F32)LLTimer::getTotalSeconds();
|
||||
|
||||
mShaderBinaryCache.insert_or_assign(shader->mShaderHash, binary_info);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
|
|||
|
||||
LLRender2D::getInstance()->pushMatrix();
|
||||
{
|
||||
LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis);
|
||||
LLVector3 rect_origin = origin_agent + ((F32)rect.mLeft * x_axis) + ((F32)rect.mBottom * y_axis);
|
||||
LLRender2D::getInstance()->translate(rect_origin.mV[VX],
|
||||
rect_origin.mV[VY],
|
||||
rect_origin.mV[VZ]);
|
||||
|
|
@ -100,8 +100,8 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
|
|||
(rect.getHeight() - (border_height * border_scale * 0.5f)) / (F32)rect.getHeight(),
|
||||
(rect.getWidth() - (border_width * border_scale * 0.5f)) / (F32)rect.getWidth(),
|
||||
(border_height * border_scale * 0.5f) / (F32)rect.getHeight()),
|
||||
rect.getWidth() * x_axis,
|
||||
rect.getHeight() * y_axis);
|
||||
(F32)rect.getWidth() * x_axis,
|
||||
(F32)rect.getHeight() * y_axis);
|
||||
|
||||
} LLRender2D::getInstance()->popMatrix();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,10 +197,10 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons
|
|||
F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f;
|
||||
F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f;
|
||||
|
||||
LLRectf screen_rect(ll_round(x),
|
||||
ll_round(y),
|
||||
ll_round(x) + width,
|
||||
ll_round(y) + height);
|
||||
LLRectf screen_rect((F32)ll_round(x),
|
||||
(F32)ll_round(y),
|
||||
(F32)ll_round(x) + width,
|
||||
(F32)ll_round(y) + height);
|
||||
|
||||
LLVector3 vertices[4];
|
||||
// <FS:Ansariel> Remove QUADS rendering mode
|
||||
|
|
@ -314,7 +314,7 @@ void LLBadge::draw()
|
|||
}
|
||||
else
|
||||
{
|
||||
badge_center_x = location_offset_horiz;
|
||||
badge_center_x = (F32)location_offset_horiz;
|
||||
}
|
||||
|
||||
// Compute y position
|
||||
|
|
@ -331,7 +331,7 @@ void LLBadge::draw()
|
|||
}
|
||||
else
|
||||
{
|
||||
badge_center_y = location_offset_vert;
|
||||
badge_center_y = (F32)location_offset_vert;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ LLButton::LLButton(const LLButton::Params& p)
|
|||
// Likewise, missing "p.button_flash_rate" is replaced by gSavedSettings.getF32("FlashPeriod").
|
||||
// Note: flashing should be allowed in settings.xml (boolean key "EnableButtonFlashing").
|
||||
S32 flash_count = p.button_flash_count.isProvided()? p.button_flash_count : 0;
|
||||
F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0;
|
||||
F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0f;
|
||||
mFlashingTimer = new LLFlashTimer ((LLFlashTimer::callback_t)NULL, flash_count, flash_rate);
|
||||
}
|
||||
else
|
||||
|
|
@ -874,8 +874,8 @@ void LLButton::draw()
|
|||
{
|
||||
mCurGlowStrength = lerp(mCurGlowStrength,
|
||||
// <FS:Ansariel> Crash fix; Calling setFlashing can cause mFlashing being true while is mFlashingTimer is NULL
|
||||
//mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength,
|
||||
(mFlashing && mFlashingTimer) ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength,
|
||||
//mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0f : 0.0f) : mHoverGlowStrength,
|
||||
(mFlashing && mFlashingTimer) ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight ? 1.0f : 0.0f) : mHoverGlowStrength,
|
||||
LLSmoothInterpolation::getInterpolant(0.05f));
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ void LLConsole::setLinePersistTime(F32 seconds)
|
|||
void LLConsole::reshape(S32 width, S32 height, bool called_from_parent)
|
||||
{
|
||||
S32 new_width = llmax(50, llmin(getRect().getWidth(), width));
|
||||
S32 new_height = llmax(llfloor(mFont->getLineHeight()) + 15, llmin(getRect().getHeight(), height));
|
||||
S32 new_height = llmax(mFont->getLineHeight() + 15, llmin(getRect().getHeight(), height));
|
||||
|
||||
if ( mConsoleWidth == new_width
|
||||
&& mConsoleHeight == new_height )
|
||||
|
|
@ -225,7 +225,7 @@ void LLConsole::draw()
|
|||
//LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground");
|
||||
//color.mV[VALPHA] *= console_opacity;
|
||||
|
||||
//F32 line_height = mFont->getLineHeight();
|
||||
//F32 line_height = (F32)mFont->getLineHeight();
|
||||
|
||||
//for(paragraph_it = mParagraphs.rbegin(); paragraph_it != mParagraphs.rend(); paragraph_it++)
|
||||
//{
|
||||
|
|
@ -284,12 +284,12 @@ void LLConsole::draw()
|
|||
LLColor4 color = cbcolor.get();
|
||||
color.mV[VALPHA] *= llclamp(consoleBackgroundOpacity(), 0.f, 1.f);
|
||||
|
||||
F32 line_height = mFont->getLineHeight();
|
||||
F32 line_height = (F32)mFont->getLineHeight();
|
||||
static LLCachedControl<bool> classic_draw_mode(*LLUI::getInstance()->mSettingGroups["config"], "FSConsoleClassicDrawMode");
|
||||
|
||||
if (classic_draw_mode)
|
||||
{
|
||||
static const F32 padding_vert = 5;
|
||||
constexpr F32 padding_vert = 5.f;
|
||||
S32 total_width = 0;
|
||||
S32 total_height = 0;
|
||||
size_t lines_drawn = 0;
|
||||
|
|
@ -315,7 +315,7 @@ void LLConsole::draw()
|
|||
total_height += llfloor( (*paragraph_it).mLines.size() * line_height + padding_vert);
|
||||
total_width = llmax(total_width, llfloor( (*paragraph_it).mMaxWidth + padding_horizontal));
|
||||
}
|
||||
mBackgroundImage->drawSolid(-14, (S32)(y_pos + line_height / 2), total_width, total_height + (line_height - padding_vert) / 2, color);
|
||||
mBackgroundImage->drawSolid(-14, (S32)(y_pos + line_height / 2), total_width, total_height + (S32)((line_height - padding_vert) / 2.f), color);
|
||||
|
||||
lines_drawn = 0;
|
||||
for (paragraph_it = mParagraphs.rbegin(); paragraph_it != paragraphs_end; ++paragraph_it)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
LLF32UICtrl::LLF32UICtrl(const Params& p)
|
||||
: LLUICtrl(p),
|
||||
mInitialValue(p.initial_value().asReal()),
|
||||
mInitialValue((F32)p.initial_value().asReal()),
|
||||
mMinValue(p.min_value),
|
||||
mMaxValue(p.max_value),
|
||||
mIncrement(p.increment)
|
||||
|
|
@ -47,5 +47,5 @@ LLF32UICtrl::LLF32UICtrl(const Params& p)
|
|||
|
||||
F32 LLF32UICtrl::getValueF32() const
|
||||
{
|
||||
return mViewModel->getValue().asReal();
|
||||
return (F32)mViewModel->getValue().asReal();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1047,8 +1047,8 @@ bool LLFloater::applyRectControl()
|
|||
&& !x_control->isDefault()
|
||||
&& !y_control->isDefault())
|
||||
{
|
||||
mPosition.mX = x_control->getValue().asReal();
|
||||
mPosition.mY = y_control->getValue().asReal();
|
||||
mPosition.mX = (LL_COORD_FLOATER::value_t)x_control->getValue().asReal();
|
||||
mPosition.mY = (LL_COORD_FLOATER::value_t)y_control->getValue().asReal();
|
||||
mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
|
||||
applyRelativePosition();
|
||||
|
||||
|
|
@ -3969,7 +3969,7 @@ void LLFloater::applyRelativePosition()
|
|||
|
||||
|
||||
LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater)
|
||||
: coord_t((S32)x, (S32)y)
|
||||
: coord_t(x, y)
|
||||
{
|
||||
mFloater = floater.getHandle();
|
||||
}
|
||||
|
|
@ -4012,28 +4012,28 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
|
|||
LLCoordCommon out;
|
||||
if (self.mX < -0.5f)
|
||||
{
|
||||
out.mX = ll_round(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
|
||||
out.mX = ll_round(rescale(self.mX, -1.f, -0.5f, (F32)(snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS)), (F32)snap_rect.mLeft));
|
||||
}
|
||||
else if (self.mX > 0.5f)
|
||||
{
|
||||
out.mX = ll_round(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
|
||||
out.mX = ll_round(rescale(self.mX, 0.5f, 1.f, (F32)(snap_rect.mRight - floater_width), (F32)(snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS)));
|
||||
}
|
||||
else
|
||||
{
|
||||
out.mX = ll_round(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
|
||||
out.mX = ll_round(rescale(self.mX, -0.5f, 0.5f, (F32)snap_rect.mLeft, (F32)(snap_rect.mRight - floater_width)));
|
||||
}
|
||||
|
||||
if (self.mY < -0.5f)
|
||||
{
|
||||
out.mY = ll_round(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
|
||||
out.mY = ll_round(rescale(self.mY, -1.f, -0.5f, (F32)(snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS)), (F32)snap_rect.mBottom));
|
||||
}
|
||||
else if (self.mY > 0.5f)
|
||||
{
|
||||
out.mY = ll_round(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
|
||||
out.mY = ll_round(rescale(self.mY, 0.5f, 1.f, (F32)(snap_rect.mTop - floater_height), (F32)(snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS)));
|
||||
}
|
||||
else
|
||||
{
|
||||
out.mY = ll_round(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
|
||||
out.mY = ll_round(rescale(self.mY, -0.5f, 0.5f, (F32)snap_rect.mBottom, (F32)(snap_rect.mTop - floater_height)));
|
||||
}
|
||||
|
||||
// return center point instead of lower left
|
||||
|
|
@ -4060,27 +4060,27 @@ void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from)
|
|||
|
||||
if (from_x < snap_rect.mLeft)
|
||||
{
|
||||
self.mX = rescale(from_x, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft, -1.f, -0.5f);
|
||||
self.mX = rescale((F32)from_x, (F32)(snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS)), (F32)snap_rect.mLeft, -1.f, -0.5f);
|
||||
}
|
||||
else if (from_x + floater_width > snap_rect.mRight)
|
||||
{
|
||||
self.mX = rescale(from_x, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS, 0.5f, 1.f);
|
||||
self.mX = rescale((F32)from_x, (F32)(snap_rect.mRight - floater_width), (F32)(snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS), 0.5f, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.mX = rescale(from_x, snap_rect.mLeft, snap_rect.mRight - floater_width, -0.5f, 0.5f);
|
||||
self.mX = rescale((F32)from_x, (F32)snap_rect.mLeft, (F32)(snap_rect.mRight - floater_width), -0.5f, 0.5f);
|
||||
}
|
||||
|
||||
if (from_y < snap_rect.mBottom)
|
||||
{
|
||||
self.mY = rescale(from_y, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom, -1.f, -0.5f);
|
||||
self.mY = rescale((F32)from_y, (F32)(snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS)), (F32)snap_rect.mBottom, -1.f, -0.5f);
|
||||
}
|
||||
else if (from_y + floater_height > snap_rect.mTop)
|
||||
{
|
||||
self.mY = rescale(from_y, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS, 0.5f, 1.f);
|
||||
self.mY = rescale((F32)from_y, (F32)(snap_rect.mTop - floater_height), (F32)(snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS), 0.5f, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.mY = rescale(from_y, snap_rect.mBottom, snap_rect.mTop - floater_height, -0.5f, 0.5f);
|
||||
self.mY = rescale((F32)from_y, (F32)snap_rect.mBottom, (F32)(snap_rect.mTop - floater_height), -0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1021,7 +1021,7 @@ void LLFolderViewItem::draw()
|
|||
S32 filter_offset = static_cast<S32>(mViewModelItem->getFilterStringOffset());
|
||||
if (filter_string_length > 0)
|
||||
{
|
||||
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
|
||||
S32 bottom = getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD;
|
||||
S32 top = getRect().getHeight() - TOP_PAD;
|
||||
if(mLabelSuffix.empty() || (font == suffix_font))
|
||||
{
|
||||
|
|
@ -1037,8 +1037,8 @@ void LLFolderViewItem::draw()
|
|||
S32 label_filter_length = llmin((S32)mLabel.size() - filter_offset, (S32)filter_string_length);
|
||||
if(label_filter_length > 0)
|
||||
{
|
||||
S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, llmin(filter_offset, (S32)mLabel.size())) - 2;
|
||||
S32 right = left + font->getWidthF32(mLabel, filter_offset, label_filter_length) + 2;
|
||||
S32 left = (S32)(ll_round(text_left) + font->getWidthF32(mLabel, 0, llmin(filter_offset, (S32)mLabel.size()))) - 2;
|
||||
S32 right = left + (S32)font->getWidthF32(mLabel, filter_offset, label_filter_length) + 2;
|
||||
LLUIImage* box_image = default_params.selection_image;
|
||||
LLRect box_rect(left, top, right, bottom);
|
||||
box_image->draw(box_rect, sFilterBGColor);
|
||||
|
|
@ -1047,8 +1047,8 @@ void LLFolderViewItem::draw()
|
|||
if(suffix_filter_length > 0)
|
||||
{
|
||||
S32 suffix_offset = llmax(0, filter_offset - (S32)mLabel.size());
|
||||
S32 left = ll_round(text_left) + font->getWidthF32(mLabel, 0, static_cast<S32>(mLabel.size())) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset) - 2;
|
||||
S32 right = left + suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length) + 2;
|
||||
S32 left = (S32)(ll_round(text_left) + font->getWidthF32(mLabel, 0, static_cast<S32>(mLabel.size())) + suffix_font->getWidthF32(mLabelSuffix, 0, suffix_offset))- 2;
|
||||
S32 right = left + (S32)suffix_font->getWidthF32(mLabelSuffix, suffix_offset, suffix_filter_length) + 2;
|
||||
LLUIImage* box_image = default_params.selection_image;
|
||||
LLRect box_rect(left, top, right, bottom);
|
||||
box_image->draw(box_rect, sFilterBGColor);
|
||||
|
|
|
|||
|
|
@ -530,8 +530,8 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
|
|||
if( *cur == '\n' )
|
||||
{
|
||||
// <FS:Ansariel> Script editor ignoring font selection
|
||||
//LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(style, cur-base);
|
||||
LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(getDefaultStyle(editor), cur-base);
|
||||
//LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(style, (S32)(cur - base));
|
||||
LLTextSegmentPtr text_segment = new LLLineBreakTextSegment(getDefaultStyle(editor), (S32)(cur - base));
|
||||
// </FS:Ansariel>
|
||||
text_segment->setToken( 0 );
|
||||
insertSegment( *seg_list, text_segment, text_len, style, editor);
|
||||
|
|
@ -563,13 +563,13 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
|
|||
LLKeywordToken* cur_token = *iter;
|
||||
if( cur_token->isHead( cur ) )
|
||||
{
|
||||
S32 seg_start = cur - base;
|
||||
S32 seg_start = (S32)(cur - base);
|
||||
while( *cur && *cur != '\n' )
|
||||
{
|
||||
// skip the rest of the line
|
||||
cur++;
|
||||
}
|
||||
S32 seg_end = cur - base;
|
||||
S32 seg_end = (S32)(cur - base);
|
||||
|
||||
//create segments from seg_start to seg_end
|
||||
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, style, editor);
|
||||
|
|
@ -613,7 +613,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
|
|||
S32 between_delimiters = 0;
|
||||
S32 seg_end = 0;
|
||||
|
||||
seg_start = cur - base;
|
||||
seg_start = (S32)(cur - base);
|
||||
cur += cur_delimiter->getLengthHead();
|
||||
|
||||
LLKeywordToken::ETokenType type = cur_delimiter->getType();
|
||||
|
|
@ -710,7 +710,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
|
|||
{
|
||||
p++;
|
||||
}
|
||||
S32 seg_len = p - cur;
|
||||
S32 seg_len = (S32)(p - cur);
|
||||
if( seg_len > 0 )
|
||||
{
|
||||
WStringMapIndex word( cur, seg_len );
|
||||
|
|
@ -718,7 +718,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
|
|||
if( map_iter != mWordTokenMap.end() )
|
||||
{
|
||||
LLKeywordToken* cur_token = map_iter->second;
|
||||
S32 seg_start = cur - base;
|
||||
S32 seg_start = (S32)(cur - base);
|
||||
S32 seg_end = seg_start + seg_len;
|
||||
|
||||
// LL_INFOS("SyntaxLSL") << "Seg: [" << word.c_str() << "]" << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ void LLLayoutPanel::setTargetDim(S32 value)
|
|||
|
||||
S32 LLLayoutPanel::getVisibleDim() const
|
||||
{
|
||||
F32 min_dim = getRelevantMinDim();
|
||||
F32 min_dim = (F32)getRelevantMinDim();
|
||||
return ll_round(mVisibleAmt
|
||||
* (min_dim
|
||||
+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
|
||||
|
|
@ -506,7 +506,7 @@ void LLLayoutStack::updateLayout()
|
|||
// </FS:Zi>
|
||||
for (LLLayoutPanel* panelp : mPanels)
|
||||
{
|
||||
F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
|
||||
F32 panel_dim = (F32)llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
|
||||
|
||||
LLRect panel_rect;
|
||||
if (mOrientation == HORIZONTAL)
|
||||
|
|
@ -526,7 +526,7 @@ void LLLayoutStack::updateLayout()
|
|||
|
||||
LLRect resize_bar_rect(panel_rect);
|
||||
F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
|
||||
F32 panel_visible_dim = panelp->getVisibleDim();
|
||||
F32 panel_visible_dim = (F32)panelp->getVisibleDim();
|
||||
S32 panel_spacing_round = (S32)(ll_round(panel_spacing));
|
||||
|
||||
if (mOrientation == HORIZONTAL)
|
||||
|
|
|
|||
|
|
@ -2193,7 +2193,7 @@ void LLLineEditor::draw()
|
|||
if (0 == mText.length() && (mReadOnly || mShowLabelFocused))
|
||||
{
|
||||
mGLFont->render(mLabel.getWString(), 0,
|
||||
mTextLeftEdge, (F32)text_bottom,
|
||||
(F32)mTextLeftEdge, (F32)text_bottom,
|
||||
label_color,
|
||||
LLFontGL::LEFT,
|
||||
LLFontGL::BOTTOM,
|
||||
|
|
@ -2218,7 +2218,7 @@ void LLLineEditor::draw()
|
|||
if (0 == mText.length())
|
||||
{
|
||||
mGLFont->render(mLabel.getWString(), 0,
|
||||
mTextLeftEdge, (F32)text_bottom,
|
||||
(F32)mTextLeftEdge, (F32)text_bottom,
|
||||
label_color,
|
||||
LLFontGL::LEFT,
|
||||
LLFontGL::BOTTOM,
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void LLScrollListBar::setValue(const LLSD& value)
|
|||
{
|
||||
if (value.has("ratio"))
|
||||
{
|
||||
mRatio = value["ratio"].asReal();
|
||||
mRatio = (F32)value["ratio"].asReal();
|
||||
}
|
||||
if (value.has("bottom"))
|
||||
{
|
||||
|
|
@ -239,7 +239,7 @@ S32 LLScrollListBar::getWidth() const
|
|||
void LLScrollListBar::draw(const LLColor4& color, const LLColor4& highlight_color) const
|
||||
{
|
||||
S32 bar_width = getWidth() - mLeftPad - mRightPad;
|
||||
S32 left = bar_width - bar_width * mRatio;
|
||||
S32 left = (S32)(bar_width - bar_width * mRatio);
|
||||
left = llclamp(left, mLeftPad, getWidth() - mRightPad - 1);
|
||||
|
||||
gl_rect_2d(left, mBottom, getWidth() - mRightPad, mBottom - 1, mColor);
|
||||
|
|
@ -637,7 +637,7 @@ void LLScrollListIconText::draw(const LLColor4& color, const LLColor4& highlight
|
|||
switch (mFontAlignment)
|
||||
{
|
||||
case LLFontGL::LEFT:
|
||||
start_text_x = icon_space + 1;
|
||||
start_text_x = icon_space + 1.f;
|
||||
start_icon_x = 1;
|
||||
break;
|
||||
case LLFontGL::RIGHT:
|
||||
|
|
@ -647,7 +647,7 @@ void LLScrollListIconText::draw(const LLColor4& color, const LLColor4& highlight
|
|||
case LLFontGL::HCENTER:
|
||||
F32 center = (F32)getWidth()* 0.5f;
|
||||
start_text_x = center + ((F32)icon_space * 0.5f);
|
||||
start_icon_x = center - (((F32)icon_space + mFont->getWidth(mText.getString())) * 0.5f);
|
||||
start_icon_x = (S32)(center - (((F32)icon_space + mFont->getWidth(mText.getString())) * 0.5f));
|
||||
break;
|
||||
}
|
||||
mFont->render(mText.getWString(), 0,
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ void LLSpellChecker::removeDictionary(const std::string& dict_language)
|
|||
{
|
||||
LLFile::remove(dict_aff);
|
||||
}
|
||||
dict_map.erase(it - dict_map.beginArray());
|
||||
dict_map.erase((LLSD::Integer)(it - dict_map.beginArray()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ F32 calc_tick_value(F32 min, F32 max)
|
|||
S32 num_whole_digits = llceil(logf(llabs(min + possible_tick_value)) * OO_LN10);
|
||||
for (S32 digit_count = -(num_whole_digits - 1); digit_count < 6; digit_count++)
|
||||
{
|
||||
F32 test_tick_value = min + (possible_tick_value * pow(10.0, digit_count));
|
||||
F32 test_tick_value = min + (possible_tick_value * (F32)pow(10.0, digit_count));
|
||||
|
||||
if (is_approx_equal((F32)(S32)test_tick_value, test_tick_value))
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ void calc_auto_scale_range(F32& min, F32& max, F32& tick)
|
|||
: llceil(logf(llabs(min)) * OO_LN10);
|
||||
|
||||
const S32 num_digits = llmax(num_digits_max, num_digits_min);
|
||||
const F32 power_of_10 = pow(10.0, num_digits - 1);
|
||||
const F32 power_of_10 = (F32)pow(10.0, num_digits - 1);
|
||||
const F32 starting_max = power_of_10 * ((max < 0.f) ? -1 : 1);
|
||||
const F32 starting_min = power_of_10 * ((min < 0.f) ? -1 : 1);
|
||||
|
||||
|
|
@ -370,13 +370,13 @@ void LLStatBar::draw()
|
|||
const LLTrace::StatType<LLTrace::CountAccumulator>& count_stat = *mStat.countStatp;
|
||||
|
||||
unit_label = std::string(count_stat.getUnitLabel()) + "/s";
|
||||
current = last_frame_recording.getPerSec(count_stat);
|
||||
min = frame_recording.getPeriodMinPerSec(count_stat, num_frames);
|
||||
max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames);
|
||||
mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames);
|
||||
current = (F32)last_frame_recording.getPerSec(count_stat);
|
||||
min = (F32)frame_recording.getPeriodMinPerSec(count_stat, num_frames);
|
||||
max = (F32)frame_recording.getPeriodMaxPerSec(count_stat, num_frames);
|
||||
mean = (F32)frame_recording.getPeriodMeanPerSec(count_stat, num_frames);
|
||||
if (mShowMedian)
|
||||
{
|
||||
display_value = frame_recording.getPeriodMedianPerSec(count_stat, num_frames);
|
||||
display_value = (F32)frame_recording.getPeriodMedianPerSec(count_stat, num_frames);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -389,10 +389,10 @@ void LLStatBar::draw()
|
|||
const LLTrace::StatType<LLTrace::EventAccumulator>& event_stat = *mStat.eventStatp;
|
||||
|
||||
unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel;
|
||||
current = last_frame_recording.getLastValue(event_stat);
|
||||
min = frame_recording.getPeriodMin(event_stat, num_frames);
|
||||
max = frame_recording.getPeriodMax(event_stat, num_frames);
|
||||
mean = frame_recording.getPeriodMean(event_stat, num_frames);
|
||||
current = (F32)last_frame_recording.getLastValue(event_stat);
|
||||
min = (F32)frame_recording.getPeriodMin(event_stat, num_frames);
|
||||
max = (F32)frame_recording.getPeriodMax(event_stat, num_frames);
|
||||
mean = (F32)frame_recording.getPeriodMean(event_stat, num_frames);
|
||||
display_value = mean;
|
||||
}
|
||||
break;
|
||||
|
|
@ -401,15 +401,15 @@ void LLStatBar::draw()
|
|||
const LLTrace::StatType<LLTrace::SampleAccumulator>& sample_stat = *mStat.sampleStatp;
|
||||
|
||||
unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel;
|
||||
current = last_frame_recording.getLastValue(sample_stat);
|
||||
min = frame_recording.getPeriodMin(sample_stat, num_frames);
|
||||
max = frame_recording.getPeriodMax(sample_stat, num_frames);
|
||||
mean = frame_recording.getPeriodMean(sample_stat, num_frames);
|
||||
current = (F32)last_frame_recording.getLastValue(sample_stat);
|
||||
min = (F32)frame_recording.getPeriodMin(sample_stat, num_frames);
|
||||
max = (F32)frame_recording.getPeriodMax(sample_stat, num_frames);
|
||||
mean = (F32)frame_recording.getPeriodMean(sample_stat, num_frames);
|
||||
num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW);
|
||||
|
||||
if (mShowMedian)
|
||||
{
|
||||
display_value = frame_recording.getPeriodMedian(sample_stat, num_frames);
|
||||
display_value = (F32)frame_recording.getPeriodMedian(sample_stat, num_frames);
|
||||
}
|
||||
else if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC)
|
||||
{
|
||||
|
|
@ -507,8 +507,8 @@ void LLStatBar::draw()
|
|||
}
|
||||
|
||||
F32 span = (mOrientation == HORIZONTAL)
|
||||
? (bar_rect.getWidth())
|
||||
: (bar_rect.getHeight());
|
||||
? (F32)(bar_rect.getWidth())
|
||||
: (F32)(bar_rect.getHeight());
|
||||
|
||||
if (mDisplayHistory && mStat.valid)
|
||||
{
|
||||
|
|
@ -531,18 +531,18 @@ void LLStatBar::draw()
|
|||
switch(mStatType)
|
||||
{
|
||||
case STAT_COUNT:
|
||||
min_value = recording.getPerSec(*mStat.countStatp);
|
||||
min_value = (F32)recording.getPerSec(*mStat.countStatp);
|
||||
max_value = min_value;
|
||||
num_samples = recording.getSampleCount(*mStat.countStatp);
|
||||
break;
|
||||
case STAT_EVENT:
|
||||
min_value = recording.getMin(*mStat.eventStatp);
|
||||
max_value = recording.getMax(*mStat.eventStatp);
|
||||
min_value = (F32)recording.getMin(*mStat.eventStatp);
|
||||
max_value = (F32)recording.getMax(*mStat.eventStatp);
|
||||
num_samples = recording.getSampleCount(*mStat.eventStatp);
|
||||
break;
|
||||
case STAT_SAMPLE:
|
||||
min_value = recording.getMin(*mStat.sampleStatp);
|
||||
max_value = recording.getMax(*mStat.sampleStatp);
|
||||
min_value = (F32)recording.getMin(*mStat.sampleStatp);
|
||||
max_value = (F32)recording.getMax(*mStat.sampleStatp);
|
||||
num_samples = recording.getSampleCount(*mStat.sampleStatp);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -74,21 +74,21 @@ void LLStatGraph::draw()
|
|||
if (mPerSec)
|
||||
{
|
||||
// <FS:Ansariel> Legacy periodic mean per second instead of per second
|
||||
//mValue = recording.getPerSec(*mNewStatFloatp);
|
||||
//mValue = (F32)recording.getPerSec(*mNewStatFloatp);
|
||||
static LLCachedControl<bool> fsStatbarLegacyMeanPerSec(*LLUI::getInstance()->mSettingGroups["config"], "FSStatbarLegacyMeanPerSec");
|
||||
if (fsStatbarLegacyMeanPerSec)
|
||||
{
|
||||
mValue = LLTrace::get_frame_recording().getPeriodMeanPerSec(*mNewStatFloatp);
|
||||
mValue = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(*mNewStatFloatp);
|
||||
}
|
||||
else
|
||||
{
|
||||
mValue = recording.getPerSec(*mNewStatFloatp);
|
||||
mValue = (F32)recording.getPerSec(*mNewStatFloatp);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
else
|
||||
{
|
||||
mValue = recording.getSum(*mNewStatFloatp);
|
||||
mValue = (F32)recording.getSum(*mNewStatFloatp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2400,7 +2400,7 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y)
|
|||
// [SL:KB] - Patch: UI-TabRearrange | Checked: 2010-06-05 (Catznip-2.5)
|
||||
if ((mAllowRearrange) && (mCurrentTabIdx >= 0) && (mTabList[mCurrentTabIdx]->mButton->hasFocus()))
|
||||
{
|
||||
S32 idxHover = iter - mTabList.begin();
|
||||
S32 idxHover = (S32)(iter - mTabList.begin());
|
||||
if ((mCurrentTabIdx >= mLockedTabCount) && (idxHover >= mLockedTabCount) && (mCurrentTabIdx != idxHover))
|
||||
{
|
||||
LLRect rctCurTab = mTabList[mCurrentTabIdx]->mButton->getRect();
|
||||
|
|
@ -2467,7 +2467,7 @@ void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible )
|
|||
LLTabTuple const *pTT = *itr;
|
||||
if( pTT->mVisible )
|
||||
{
|
||||
this->selectTab( itr - mTabList.begin() );
|
||||
this->selectTab((S32)(itr - mTabList.begin()));
|
||||
foundTab = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -540,8 +540,8 @@ std::vector<LLRect> LLTextBase::getSelectionRects()
|
|||
|
||||
// Use F32 otherwise a string of multiple segments
|
||||
// will accumulate a large error
|
||||
F32 left_precise = line_iter->mRect.mLeft;
|
||||
F32 right_precise = line_iter->mRect.mLeft;
|
||||
F32 left_precise = (F32)line_iter->mRect.mLeft;
|
||||
F32 right_precise = (F32)line_iter->mRect.mLeft;
|
||||
|
||||
for (; segment_iter != mSegments.end(); ++segment_iter, segment_offset = 0)
|
||||
{
|
||||
|
|
@ -587,8 +587,8 @@ std::vector<LLRect> LLTextBase::getSelectionRects()
|
|||
}
|
||||
|
||||
LLRect selection_rect;
|
||||
selection_rect.mLeft = left_precise;
|
||||
selection_rect.mRight = right_precise;
|
||||
selection_rect.mLeft = (S32)left_precise;
|
||||
selection_rect.mRight = (S32)right_precise;
|
||||
selection_rect.mBottom = line_iter->mRect.mBottom;
|
||||
selection_rect.mTop = line_iter->mRect.mTop;
|
||||
|
||||
|
|
@ -737,7 +737,7 @@ void LLTextBase::drawCursor()
|
|||
|
||||
// Make sure the IME is in the right place
|
||||
LLRect screen_pos = calcScreenRect();
|
||||
LLCoordGL ime_pos( screen_pos.mLeft + llfloor(cursor_rect.mLeft), screen_pos.mBottom + llfloor(cursor_rect.mTop) );
|
||||
LLCoordGL ime_pos( screen_pos.mLeft + cursor_rect.mLeft, screen_pos.mBottom + cursor_rect.mTop );
|
||||
|
||||
ime_pos.mX = (S32) (ime_pos.mX * LLUI::getScaleFactor().mV[VX]);
|
||||
ime_pos.mY = (S32) (ime_pos.mY * LLUI::getScaleFactor().mV[VY]);
|
||||
|
|
@ -900,9 +900,9 @@ void LLTextBase::drawText()
|
|||
line_end = next_start;
|
||||
}
|
||||
|
||||
LLRectf text_rect(line.mRect.mLeft, line.mRect.mTop, line.mRect.mRight, line.mRect.mBottom);
|
||||
text_rect.mRight = mDocumentView->getRect().getWidth(); // clamp right edge to document extents
|
||||
text_rect.translate(mDocumentView->getRect().mLeft, mDocumentView->getRect().mBottom); // adjust by scroll position
|
||||
LLRectf text_rect((F32)line.mRect.mLeft, (F32)line.mRect.mTop, (F32)line.mRect.mRight, (F32)line.mRect.mBottom);
|
||||
text_rect.mRight = (F32)mDocumentView->getRect().getWidth(); // clamp right edge to document extents
|
||||
text_rect.translate((F32)mDocumentView->getRect().mLeft, (F32)mDocumentView->getRect().mBottom); // adjust by scroll position
|
||||
|
||||
// draw a single line of text
|
||||
S32 seg_start = line_start;
|
||||
|
|
@ -947,13 +947,13 @@ void LLTextBase::drawText()
|
|||
S32 squiggle_start = 0, squiggle_end = 0, pony = 0;
|
||||
cur_segment->getDimensions(seg_start - cur_segment->getStart(), misspell_start - seg_start, squiggle_start, pony);
|
||||
cur_segment->getDimensions(misspell_start - cur_segment->getStart(), misspell_end - misspell_start, squiggle_end, pony);
|
||||
squiggle_start += text_rect.mLeft;
|
||||
squiggle_start += (S32)text_rect.mLeft;
|
||||
|
||||
pony = (squiggle_end + 3) / 6;
|
||||
squiggle_start += squiggle_end / 2 - pony * 3;
|
||||
squiggle_end = squiggle_start + pony * 6;
|
||||
|
||||
S32 squiggle_bottom = text_rect.mBottom + (S32)cur_segment->getStyle()->getFont()->getDescenderHeight();
|
||||
S32 squiggle_bottom = (S32)text_rect.mBottom + (S32)cur_segment->getStyle()->getFont()->getDescenderHeight();
|
||||
|
||||
gGL.color4ub(255, 0, 0, 200);
|
||||
while (squiggle_start + 1 < squiggle_end)
|
||||
|
|
@ -1843,7 +1843,7 @@ void LLTextBase::reflow()
|
|||
segment_set_t::iterator seg_iter = mSegments.begin();
|
||||
S32 seg_offset = 0;
|
||||
S32 line_start_index = 0;
|
||||
const F32 text_available_width = mVisibleTextRect.getWidth() - mHPad; // reserve room for margin
|
||||
const F32 text_available_width = (F32)(mVisibleTextRect.getWidth() - mHPad); // reserve room for margin
|
||||
F32 remaining_pixels = text_available_width;
|
||||
S32 line_count = 0;
|
||||
|
||||
|
|
@ -2050,7 +2050,7 @@ S32 LLTextBase::getLineNumFromDocIndex( S32 doc_index, bool include_wordwrap) co
|
|||
line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_index, line_end_compare());
|
||||
if (include_wordwrap)
|
||||
{
|
||||
return iter - mLineInfoList.begin();
|
||||
return (S32)(iter - mLineInfoList.begin());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2087,7 +2087,7 @@ S32 LLTextBase::getFirstVisibleLine() const
|
|||
// binary search for line that starts before top of visible buffer
|
||||
line_list_t::const_iterator iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_bottom());
|
||||
|
||||
return iter - mLineInfoList.begin();
|
||||
return (S32)(iter - mLineInfoList.begin());
|
||||
}
|
||||
|
||||
std::pair<S32, S32> LLTextBase::getVisibleLines(bool require_fully_visible)
|
||||
|
|
@ -2109,7 +2109,7 @@ std::pair<S32, S32> LLTextBase::getVisibleLines(bool require_fully_visible)
|
|||
first_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_bottom());
|
||||
last_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mBottom, compare_top());
|
||||
}
|
||||
return std::pair<S32, S32>(first_iter - mLineInfoList.begin(), last_iter - mLineInfoList.begin());
|
||||
return std::pair<S32, S32>((S32)(first_iter - mLineInfoList.begin()), (S32)(last_iter - mLineInfoList.begin()));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2910,7 +2910,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, bool round,
|
|||
}
|
||||
|
||||
S32 pos = getLength();
|
||||
F32 start_x = line_iter->mRect.mLeft + doc_rect.mLeft;
|
||||
F32 start_x = (F32)(line_iter->mRect.mLeft + doc_rect.mLeft);
|
||||
|
||||
segment_set_t::iterator line_seg_iter;
|
||||
S32 line_seg_offset;
|
||||
|
|
@ -2928,7 +2928,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, bool round,
|
|||
|
||||
if(newline)
|
||||
{
|
||||
pos = segment_line_start + segmentp->getOffset(local_x - start_x, line_seg_offset, segment_line_length, round);
|
||||
pos = segment_line_start + segmentp->getOffset(local_x - (S32)start_x, line_seg_offset, segment_line_length, round);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2958,7 +2958,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, bool round,
|
|||
}
|
||||
else
|
||||
{
|
||||
offset = segmentp->getOffset(local_x - start_x, line_seg_offset, segment_line_length, round);
|
||||
offset = segmentp->getOffset(local_x - (S32)start_x, line_seg_offset, segment_line_length, round);
|
||||
}
|
||||
pos = segment_line_start + offset;
|
||||
break;
|
||||
|
|
@ -3005,7 +3005,7 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const
|
|||
getSegmentAndOffset(line_iter->mDocIndexStart, &line_seg_iter, &line_seg_offset);
|
||||
getSegmentAndOffset(pos, &cursor_seg_iter, &cursor_seg_offset);
|
||||
|
||||
F32 doc_left_precise = line_iter->mRect.mLeft;
|
||||
F32 doc_left_precise = (F32)line_iter->mRect.mLeft;
|
||||
|
||||
while(line_seg_iter != mSegments.end())
|
||||
{
|
||||
|
|
@ -3036,7 +3036,7 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const
|
|||
}
|
||||
|
||||
LLRect doc_rect;
|
||||
doc_rect.mLeft = doc_left_precise;
|
||||
doc_rect.mLeft = (S32)doc_left_precise;
|
||||
doc_rect.mBottom = line_iter->mRect.mBottom;
|
||||
doc_rect.mTop = line_iter->mRect.mTop;
|
||||
|
||||
|
|
@ -3223,7 +3223,7 @@ void LLTextBase::refreshHighlights()
|
|||
|
||||
for (std::list<boost::iterator_range<LLWString::const_iterator> >::const_iterator itRange = highlightRanges.begin(); itRange != highlightRanges.end(); ++itRange)
|
||||
{
|
||||
S32 idxStart = itRange->begin() - wstrText.begin();
|
||||
S32 idxStart = (S32)(itRange->begin() - wstrText.begin());
|
||||
mHighlights.emplace_back(range_pair_t(idxStart, idxStart + static_cast<S32>(itRange->size())));
|
||||
}
|
||||
}
|
||||
|
|
@ -4086,7 +4086,7 @@ bool LLInlineViewSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& w
|
|||
}
|
||||
else
|
||||
{
|
||||
width = mLeftPad + mRightPad + mView->getRect().getWidth();
|
||||
width = (F32)(mLeftPad + mRightPad + mView->getRect().getWidth());
|
||||
height = mBottomPad + mTopPad + mView->getRect().getHeight();
|
||||
}
|
||||
|
||||
|
|
@ -4237,10 +4237,10 @@ F32 LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 select
|
|||
S32 style_image_width = image->getWidth();
|
||||
// Text is drawn from the top of the draw_rect downward
|
||||
|
||||
S32 text_center = draw_rect.mTop - (draw_rect.getHeight() / 2);
|
||||
S32 text_center = (S32)(draw_rect.mTop - (draw_rect.getHeight() / 2.f));
|
||||
// Align image to center of draw rect
|
||||
S32 image_bottom = text_center - (style_image_height / 2);
|
||||
image->draw(draw_rect.mLeft, image_bottom,
|
||||
image->draw((S32)draw_rect.mLeft, image_bottom,
|
||||
style_image_width, style_image_height, color);
|
||||
|
||||
const S32 IMAGE_HPAD = 3;
|
||||
|
|
|
|||
|
|
@ -2505,17 +2505,17 @@ void LLTextEditor::drawPreeditMarker()
|
|||
if (mPreeditStandouts[i])
|
||||
{
|
||||
gl_rect_2d(preedit_left + preedit_standout_gap,
|
||||
text_rect.mBottom + mFont->getDescenderHeight() - 1,
|
||||
text_rect.mBottom + (S32)mFont->getDescenderHeight() - 1,
|
||||
preedit_right - preedit_standout_gap - 1,
|
||||
text_rect.mBottom + mFont->getDescenderHeight() - 1 - preedit_standout_thickness,
|
||||
text_rect.mBottom + (S32)mFont->getDescenderHeight() - 1 - preedit_standout_thickness,
|
||||
(mCursorColor.get() * preedit_standout_brightness + mWriteableBgColor.get() * (1 - preedit_standout_brightness)).setAlpha(1.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_rect_2d(preedit_left + preedit_marker_gap,
|
||||
text_rect.mBottom + mFont->getDescenderHeight() - 1,
|
||||
text_rect.mBottom + (S32)mFont->getDescenderHeight() - 1,
|
||||
preedit_right - preedit_marker_gap - 1,
|
||||
text_rect.mBottom + mFont->getDescenderHeight() - 1 - preedit_marker_thickness,
|
||||
text_rect.mBottom + (S32)mFont->getDescenderHeight() - 1 - preedit_marker_thickness,
|
||||
(mCursorColor.get() * preedit_marker_brightness + mWriteableBgColor.get() * (1 - preedit_marker_brightness)).setAlpha(1.0f));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,19 +217,19 @@ void LLVirtualTrackball::draw()
|
|||
|
||||
S32 halfwidth = mTouchArea->getRect().getWidth() / 2;
|
||||
S32 halfheight = mTouchArea->getRect().getHeight() / 2;
|
||||
draw_point.mV[VX] = (draw_point.mV[VX] + 1.0) * halfwidth + mTouchArea->getRect().mLeft;
|
||||
draw_point.mV[VY] = (draw_point.mV[VY] + 1.0) * halfheight + mTouchArea->getRect().mBottom;
|
||||
draw_point.mV[VX] = (draw_point.mV[VX] + 1.0f) * halfwidth + mTouchArea->getRect().mLeft;
|
||||
draw_point.mV[VY] = (draw_point.mV[VY] + 1.0f) * halfheight + mTouchArea->getRect().mBottom;
|
||||
bool upper_hemisphere = (draw_point.mV[VZ] >= 0.f);
|
||||
|
||||
mImgSphere->draw(mTouchArea->getRect(), upper_hemisphere ? UI_VERTEX_COLOR : UI_VERTEX_COLOR % 0.5f);
|
||||
drawThumb(draw_point.mV[VX], draw_point.mV[VY], mThumbMode, upper_hemisphere);
|
||||
drawThumb((S32)draw_point.mV[VX], (S32)draw_point.mV[VY], mThumbMode, upper_hemisphere);
|
||||
|
||||
|
||||
if (LLView::sDebugRects)
|
||||
{
|
||||
gGL.color4fv(LLColor4::red.mV);
|
||||
gl_circle_2d(mTouchArea->getRect().getCenterX(), mTouchArea->getRect().getCenterY(), mImgSphere->getWidth() / 2, 60, false);
|
||||
gl_circle_2d(draw_point.mV[VX], draw_point.mV[VY], mImgSunFront->getWidth() / 2, 12, false);
|
||||
gl_circle_2d((F32)mTouchArea->getRect().getCenterX(), (F32)mTouchArea->getRect().getCenterY(), (F32)mImgSphere->getWidth() / 2.f, 60, false);
|
||||
gl_circle_2d(draw_point.mV[VX], draw_point.mV[VY], (F32)mImgSunFront->getWidth() / 2.f, 12, false);
|
||||
}
|
||||
|
||||
// hide the direction labels when disabled
|
||||
|
|
@ -392,20 +392,20 @@ bool LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
|
|||
{ // trackball (move to roll) mode
|
||||
LLQuaternion delta;
|
||||
|
||||
F32 rotX = x - mPrevX;
|
||||
F32 rotY = y - mPrevY;
|
||||
F32 rotX = (F32)(x - mPrevX);
|
||||
F32 rotY = (F32)(y - mPrevY);
|
||||
|
||||
if (llabs(rotX) > 1)
|
||||
if (abs(rotX) > 1)
|
||||
{
|
||||
F32 direction = (rotX < 0) ? -1 : 1;
|
||||
delta.setAngleAxis(mIncrementMouse * llabs(rotX), 0, direction, 0); // changing X - rotate around Y axis
|
||||
F32 direction = (rotX < 0) ? -1.f : 1.f;
|
||||
delta.setAngleAxis(mIncrementMouse * abs(rotX), 0.f, direction, 0.f); // changing X - rotate around Y axis
|
||||
mValue *= delta;
|
||||
}
|
||||
|
||||
if (llabs(rotY) > 1)
|
||||
{
|
||||
F32 direction = (rotY < 0) ? 1 : -1; // reverse for Y (value increases from bottom to top)
|
||||
delta.setAngleAxis(mIncrementMouse * llabs(rotY), direction, 0, 0); // changing Y - rotate around X axis
|
||||
F32 direction = (rotY < 0) ? 1.f : -1.f; // reverse for Y (value increases from bottom to top)
|
||||
delta.setAngleAxis(mIncrementMouse * abs(rotY), direction, 0.f, 0.f); // changing Y - rotate around X axis
|
||||
mValue *= delta;
|
||||
}
|
||||
}
|
||||
|
|
@ -416,10 +416,10 @@ bool LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask)
|
|||
return true; // don't drag outside the circle
|
||||
}
|
||||
|
||||
F32 radius = mTouchArea->getRect().getWidth() / 2;
|
||||
F32 xx = x - mTouchArea->getRect().getCenterX();
|
||||
F32 yy = y - mTouchArea->getRect().getCenterY();
|
||||
F32 dist = sqrt(pow(xx, 2) + pow(yy, 2));
|
||||
F32 radius = (F32)mTouchArea->getRect().getWidth() / 2.f;
|
||||
F32 xx = (F32)(x - mTouchArea->getRect().getCenterX());
|
||||
F32 yy = (F32)(y - mTouchArea->getRect().getCenterY());
|
||||
F32 dist = (F32)(sqrt(pow(xx, 2) + pow(yy, 2)));
|
||||
|
||||
F32 azimuth = llclamp(acosf(xx / dist), 0.0f, F_PI);
|
||||
F32 altitude = llclamp(acosf(dist / radius), 0.0f, F_PI_BY_TWO);
|
||||
|
|
|
|||
|
|
@ -159,15 +159,15 @@ void drawArrow(S32 tailX, S32 tailY, S32 tipX, S32 tipY, LLColor4 color)
|
|||
|
||||
S32 arrowLength = (abs(dx) < ARROW_LENGTH_LONG && abs(dy) < ARROW_LENGTH_LONG) ? ARROW_LENGTH_SHORT : ARROW_LENGTH_LONG;
|
||||
|
||||
F32 theta = std::atan2(dy, dx);
|
||||
F32 theta = (F32)std::atan2(dy, dx);
|
||||
|
||||
F32 rad = ARROW_ANGLE * std::atan(1) * 4 / 180;
|
||||
F32 rad = (F32)(ARROW_ANGLE * std::atan(1) * 4 / 180);
|
||||
F32 x = tipX - arrowLength * cos(theta + rad);
|
||||
F32 y = tipY - arrowLength * sin(theta + rad);
|
||||
F32 rad2 = -1 * ARROW_ANGLE * std::atan(1) * 4 / 180;
|
||||
F32 rad2 = (F32)(-1 * ARROW_ANGLE * std::atan(1) * 4 / 180);
|
||||
F32 x2 = tipX - arrowLength * cos(theta + rad2);
|
||||
F32 y2 = tipY - arrowLength * sin(theta + rad2);
|
||||
gl_triangle_2d(tipX, tipY, x, y, x2, y2, color, true);
|
||||
gl_triangle_2d(tipX, tipY, (S32)x, (S32)y, (S32)x2, (S32)y2, color, true);
|
||||
}
|
||||
|
||||
void LLXYVector::draw()
|
||||
|
|
@ -179,18 +179,18 @@ void LLXYVector::draw()
|
|||
|
||||
if (mLogarithmic)
|
||||
{
|
||||
pointX = (log(llabs(mValueX) + 1)) / mLogScaleX;
|
||||
pointX = (S32)((log(llabs(mValueX) + 1)) / mLogScaleX);
|
||||
pointX *= (mValueX < 0) ? -1 : 1;
|
||||
pointX += centerX;
|
||||
|
||||
pointY = (log(llabs(mValueY) + 1)) / mLogScaleY;
|
||||
pointY = (S32)((log(llabs(mValueY) + 1)) / mLogScaleY);
|
||||
pointY *= (mValueY < 0) ? -1 : 1;
|
||||
pointY += centerY;
|
||||
}
|
||||
else // linear
|
||||
{
|
||||
pointX = centerX + (mValueX * mTouchArea->getRect().getWidth() / (2 * mMaxValueX));
|
||||
pointY = centerY + (mValueY * mTouchArea->getRect().getHeight() / (2 * mMaxValueY));
|
||||
pointX = centerX + (S32)(mValueX * mTouchArea->getRect().getWidth() / (2 * mMaxValueX));
|
||||
pointY = centerY + (S32)(mValueY * mTouchArea->getRect().getHeight() / (2 * mMaxValueY));
|
||||
}
|
||||
|
||||
// fill
|
||||
|
|
@ -223,7 +223,7 @@ void LLXYVector::draw()
|
|||
}
|
||||
|
||||
// draw center circle
|
||||
gl_circle_2d(centerX, centerY, CENTER_CIRCLE_RADIUS, 12, true);
|
||||
gl_circle_2d((F32)centerX, (F32)centerY, CENTER_CIRCLE_RADIUS, 12, true);
|
||||
|
||||
LLView::draw();
|
||||
}
|
||||
|
|
@ -232,7 +232,7 @@ void LLXYVector::onEditChange()
|
|||
{
|
||||
if (getEnabled())
|
||||
{
|
||||
setValueAndCommit(mXEntry->getValue().asReal(), mYEntry->getValue().asReal());
|
||||
setValueAndCommit((F32)mXEntry->getValue().asReal(), (F32)mYEntry->getValue().asReal());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ void LLXYVector::setValue(const LLSD& value)
|
|||
{
|
||||
if (value.isArray())
|
||||
{
|
||||
setValue(value[0].asReal(), value[1].asReal());
|
||||
setValue((F32)value[0].asReal(), (F32)value[1].asReal());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor)
|
|||
|
||||
//convert BSTR to std::string
|
||||
std::wstring ws(caption, SysStringLen(caption));
|
||||
std::string caption_str(ws.begin(), ws.end());
|
||||
std::string caption_str = ll_convert_wide_to_string(ws);
|
||||
LLStringUtil::toLower(caption_str);
|
||||
|
||||
bool found = false;
|
||||
|
|
@ -432,7 +432,7 @@ std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor)
|
|||
|
||||
//convert BSTR to std::string
|
||||
std::wstring ws(driverVersion, SysStringLen(driverVersion));
|
||||
std::string str(ws.begin(), ws.end());
|
||||
std::string str = ll_convert_wide_to_string(ws);
|
||||
LL_INFOS("AppInit") << " DriverVersion : " << str << LL_ENDL;
|
||||
|
||||
if (mDriverVersion.empty())
|
||||
|
|
@ -841,7 +841,7 @@ bool LLDXHardware::getInfo(bool vram_only, bool disable_wmi)
|
|||
}
|
||||
}
|
||||
// <FS:Beq> Deprecate WMI use DXGI in preference.
|
||||
mVRAM = GetVideoMemoryViaDXGI()/1024/1024;
|
||||
mVRAM = (S32)(GetVideoMemoryViaDXGI()/1024/1024);
|
||||
LL_INFOS("AppInit") << "VRAM Detected via DXGI: " << mVRAM << "MB" << LL_ENDL;
|
||||
// </FS:Beq>
|
||||
|
||||
|
|
|
|||
|
|
@ -1813,7 +1813,7 @@ void* LLWindowWin32::createSharedContext()
|
|||
mMaxGLVersion = llclamp(mMaxGLVersion, 3.f, 4.6f);
|
||||
|
||||
S32 version_major = llfloor(mMaxGLVersion);
|
||||
S32 version_minor = llround((mMaxGLVersion-version_major)*10);
|
||||
S32 version_minor = (S32)llround((mMaxGLVersion-version_major)*10);
|
||||
|
||||
S32 attribs[] =
|
||||
{
|
||||
|
|
@ -2503,12 +2503,12 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
{
|
||||
window_imp->mKeyCharCode = 0; // don't know until wm_char comes in next
|
||||
window_imp->mKeyScanCode = (l_param >> 16) & 0xff;
|
||||
window_imp->mKeyVirtualKey = w_param;
|
||||
window_imp->mKeyVirtualKey = (U32)w_param;
|
||||
window_imp->mRawMsg = u_msg;
|
||||
window_imp->mRawWParam = w_param;
|
||||
window_imp->mRawLParam = l_param;
|
||||
window_imp->mRawWParam = (U32)w_param;
|
||||
window_imp->mRawLParam = (U32)l_param;
|
||||
|
||||
gKeyboard->handleKeyDown(w_param, mask);
|
||||
gKeyboard->handleKeyDown((U16)w_param, mask);
|
||||
});
|
||||
if (eat_keystroke) return 0; // skip DefWindowProc() handling if we're consuming the keypress
|
||||
break;
|
||||
|
|
@ -2523,14 +2523,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
window_imp->post([=]()
|
||||
{
|
||||
window_imp->mKeyScanCode = (l_param >> 16) & 0xff;
|
||||
window_imp->mKeyVirtualKey = w_param;
|
||||
window_imp->mKeyVirtualKey = (U32)w_param;
|
||||
window_imp->mRawMsg = u_msg;
|
||||
window_imp->mRawWParam = w_param;
|
||||
window_imp->mRawLParam = l_param;
|
||||
window_imp->mRawWParam = (U32)w_param;
|
||||
window_imp->mRawLParam = (U32)l_param;
|
||||
|
||||
{
|
||||
LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_KEYUP");
|
||||
gKeyboard->handleKeyUp(w_param, mask);
|
||||
gKeyboard->handleKeyUp((U16)w_param, mask);
|
||||
}
|
||||
});
|
||||
if (eat_keystroke) return 0; // skip DefWindowProc() handling if we're consuming the keypress
|
||||
|
|
@ -2570,7 +2570,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_IME_COMPOSITION");
|
||||
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
|
||||
{
|
||||
WINDOW_IMP_POST(window_imp->handleCompositionMessage(l_param));
|
||||
WINDOW_IMP_POST(window_imp->handleCompositionMessage((U32)l_param));
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2591,10 +2591,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
LL_PROFILE_ZONE_NAMED_CATEGORY_WIN32("mwp - WM_CHAR");
|
||||
window_imp->post([=]()
|
||||
{
|
||||
window_imp->mKeyCharCode = w_param;
|
||||
window_imp->mKeyCharCode = (U32)w_param;
|
||||
window_imp->mRawMsg = u_msg;
|
||||
window_imp->mRawWParam = w_param;
|
||||
window_imp->mRawLParam = l_param;
|
||||
window_imp->mRawWParam = (U32)w_param;
|
||||
window_imp->mRawLParam = (U32)l_param;
|
||||
|
||||
// Should really use WM_UNICHAR eventually, but it requires a specific Windows version and I need
|
||||
// to figure out how that works. - Doug
|
||||
|
|
@ -3032,7 +3032,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
|
||||
window_imp->post([=]()
|
||||
{
|
||||
window_imp->mCallbacks->handleDataCopy(window_imp, myType, data);
|
||||
window_imp->mCallbacks->handleDataCopy(window_imp, (S32)myType, data);
|
||||
delete[] data;
|
||||
});
|
||||
};
|
||||
|
|
@ -3092,8 +3092,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
S32 width = GetSystemMetrics(v_desktop ? SM_CXVIRTUALSCREEN : SM_CXSCREEN);
|
||||
S32 height = GetSystemMetrics(v_desktop ? SM_CYVIRTUALSCREEN : SM_CYSCREEN);
|
||||
|
||||
absolute_x = (raw->data.mouse.lLastX / 65535.0f) * width;
|
||||
absolute_y = (raw->data.mouse.lLastY / 65535.0f) * height;
|
||||
absolute_x = (S32)((raw->data.mouse.lLastX / 65535.0f) * width);
|
||||
absolute_y = (S32)((raw->data.mouse.lLastY / 65535.0f) * height);
|
||||
}
|
||||
|
||||
window_imp->mRawMouseDelta.mX += absolute_x - prev_absolute_x;
|
||||
|
|
@ -3114,8 +3114,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
}
|
||||
else
|
||||
{
|
||||
window_imp->mRawMouseDelta.mX += round((F32)raw->data.mouse.lLastX * (F32)speed / DEFAULT_SPEED);
|
||||
window_imp->mRawMouseDelta.mY -= round((F32)raw->data.mouse.lLastY * (F32)speed / DEFAULT_SPEED);
|
||||
window_imp->mRawMouseDelta.mX += (S32)round((F32)raw->data.mouse.lLastX * (F32)speed / DEFAULT_SPEED);
|
||||
window_imp->mRawMouseDelta.mY -= (S32)round((F32)raw->data.mouse.lLastY * (F32)speed / DEFAULT_SPEED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4769,7 +4769,7 @@ void LLWindowWin32::LLWindowWin32Thread::checkDXMem()
|
|||
DXGI_ADAPTER_DESC desc;
|
||||
p_dxgi_adapter->GetDesc(&desc);
|
||||
std::wstring description_w((wchar_t*)desc.Description);
|
||||
std::string description(description_w.begin(), description_w.end());
|
||||
std::string description = ll_convert_wide_to_string(description_w);
|
||||
LL_INFOS("Window") << "Graphics adapter index: " << graphics_adapter_index << ", "
|
||||
<< "Description: " << description << ", "
|
||||
<< "DeviceId: " << desc.DeviceId << ", "
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
|
|||
mTextureWidth = texture_width;
|
||||
mTextureHeight = texture_height;
|
||||
|
||||
libvlc_time_t time = 1000.0 * mCurTime;
|
||||
libvlc_time_t time = (libvlc_time_t)(1000.0 * mCurTime);
|
||||
|
||||
playMedia();
|
||||
|
||||
|
|
@ -655,7 +655,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
|
|||
{
|
||||
if (mLibVLCMediaPlayer)
|
||||
{
|
||||
libvlc_time_t time = 1000.0 * message_in.getValueReal("time");
|
||||
libvlc_time_t time = (libvlc_time_t)(1000.0 * message_in.getValueReal("time"));
|
||||
libvlc_media_player_set_time(mLibVLCMediaPlayer, time);
|
||||
time = libvlc_media_player_get_time(mLibVLCMediaPlayer);
|
||||
if (time < 0)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ void NACLAntiSpamQueueEntry::updateEntryAmount()
|
|||
|
||||
void NACLAntiSpamQueueEntry::updateEntryTime()
|
||||
{
|
||||
mEntryTime = time(NULL);
|
||||
mEntryTime = (U32)time(NULL);
|
||||
}
|
||||
|
||||
void NACLAntiSpamQueueEntry::setBlocked()
|
||||
|
|
@ -149,7 +149,7 @@ EAntispamCheckResult NACLAntiSpamQueue::checkEntry(const LLUUID& name, U32 multi
|
|||
return EAntispamCheckResult::ExistingBlock;
|
||||
}
|
||||
U32 eTime = it->second->getEntryTime();
|
||||
U32 currentTime = time(0);
|
||||
U32 currentTime = (U32)time(0);
|
||||
if ((currentTime - eTime) <= mQueueTime)
|
||||
{
|
||||
it->second->updateEntryAmount();
|
||||
|
|
@ -581,7 +581,7 @@ EAntispamCheckResult NACLAntiSpamRegistry::checkGlobalEntry(const LLUUID& source
|
|||
}
|
||||
|
||||
U32 eTime = it->second->getEntryTime();
|
||||
U32 currentTime = time(NULL);
|
||||
U32 currentTime = (U32)time(NULL);
|
||||
if ((currentTime - eTime) <= mGlobalTime)
|
||||
{
|
||||
it->second->updateEntryAmount();
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ void AOEngine::enable(bool enable)
|
|||
|
||||
void AOEngine::setStateCycleTimer(const AOSet::AOState* state)
|
||||
{
|
||||
F32 timeout = state->mCycleTime;
|
||||
F32 timeout = (F32)state->mCycleTime;
|
||||
LL_DEBUGS("AOEngine") << "Setting cycle timeout for state " << state->mName << " of " << timeout << LL_ENDL;
|
||||
if (timeout > 0.0f)
|
||||
{
|
||||
|
|
@ -1719,7 +1719,7 @@ bool AOEngine::renameSet(AOSet* set, const std::string& name)
|
|||
void AOEngine::saveState(const AOSet::AOState* state)
|
||||
{
|
||||
std::string stateParams = state->mName;
|
||||
F32 time = state->mCycleTime;
|
||||
F32 time = (F32)state->mCycleTime;
|
||||
if (time > 0.0f)
|
||||
{
|
||||
std::ostringstream timeStr;
|
||||
|
|
@ -1932,7 +1932,7 @@ void AOEngine::setRandomize(AOSet::AOState* state, bool randomize)
|
|||
|
||||
void AOEngine::setCycleTime(AOSet::AOState* state, F32 time)
|
||||
{
|
||||
state->mCycleTime = time;
|
||||
state->mCycleTime = (S32)time;
|
||||
state->mDirty = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ AOSet::AOSet(const LLUUID inventoryID)
|
|||
mStates[index].mCurrentAnimationID = LLUUID::null;
|
||||
mStates[index].mCycle = false;
|
||||
mStates[index].mRandom = false;
|
||||
mStates[index].mCycleTime = 0.0f;
|
||||
mStates[index].mCycleTime = 0;
|
||||
mStates[index].mDirty = false;
|
||||
mStateNames.emplace_back(stateNameList[0]);
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ const LLUUID& AOSet::getAnimationForState(AOState* state) const
|
|||
{
|
||||
if (state->mRandom)
|
||||
{
|
||||
state->mCurrentAnimation = ll_frand() * numOfAnimations;
|
||||
state->mCurrentAnimation = (U32)(ll_frand() * numOfAnimations);
|
||||
LL_DEBUGS("AOEngine") << "randomly chosen " << state->mCurrentAnimation << " of " << numOfAnimations << LL_ENDL;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest
|
|||
{
|
||||
if (!(i >> z))
|
||||
{
|
||||
z = gAgent.getPositionGlobal().mdV[VZ];
|
||||
z = (F32)gAgent.getPositionGlobal().mdV[VZ];
|
||||
}
|
||||
LLViewerRegion* agentRegionp = gAgent.getRegion();
|
||||
if (agentRegionp)
|
||||
|
|
@ -664,7 +664,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest
|
|||
if (i >> band_width)
|
||||
{
|
||||
band_width = llclamp(band_width, 50, 3000);
|
||||
gSavedSettings.setF32("ThrottleBandwidthKBPS", band_width);
|
||||
gSavedSettings.setF32("ThrottleBandwidthKBPS", (F32)band_width);
|
||||
LLStringUtil::format_map_t args;
|
||||
std::string bw_cmd_respond;
|
||||
args["[VALUE]"] = llformat ("%d", band_width);
|
||||
|
|
|
|||
|
|
@ -81,12 +81,12 @@ constexpr F32 MIN_DISTANCE_MOVED = 1.0f;
|
|||
// timeout to resend object properties request again
|
||||
constexpr F32 REQUEST_TIMEOUT = 30.0f;
|
||||
|
||||
std::string RLVa_hideNameIfRestricted(std::string const &name)
|
||||
static std::string RLVa_hideNameIfRestricted(std::string_view name)
|
||||
{
|
||||
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
return name;
|
||||
return std::string(name);
|
||||
else
|
||||
return RlvStrings::getAnonym(name);
|
||||
return RlvStrings::getAnonym(std::string(name));
|
||||
}
|
||||
|
||||
F32 calculateObjectDistance(LLVector3d agent_pos, LLViewerObject* object)
|
||||
|
|
@ -97,7 +97,7 @@ F32 calculateObjectDistance(LLVector3d agent_pos, LLViewerObject* object)
|
|||
}
|
||||
else
|
||||
{
|
||||
return dist_vec(agent_pos, object->getPositionGlobal());
|
||||
return (F32)dist_vec(agent_pos, object->getPositionGlobal());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1841,7 +1841,7 @@ bool FSPanelAreaSearchList::onContextMenuItemClick(const LLSD& userdata)
|
|||
LLVector3d axis_y = LLVector3d(0, 1, 0) * bbox.getRotation();
|
||||
LLVector3d axis_z = LLVector3d(0, 0, 1) * bbox.getRotation();
|
||||
//Normal of nearclip plane is camera_dir.
|
||||
F32 min_near_clip_dist = bbox_extents.mdV[0] * (camera_dir * axis_x) + bbox_extents.mdV[1] * (camera_dir * axis_y) + bbox_extents.mdV[2] * (camera_dir * axis_z); // http://www.gamasutra.com/view/feature/131790/simple_intersection_tests_for_games.php?page=7
|
||||
F32 min_near_clip_dist = (F32)(bbox_extents.mdV[0] * (camera_dir * axis_x) + bbox_extents.mdV[1] * (camera_dir * axis_y) + bbox_extents.mdV[2] * (camera_dir * axis_z)); // http://www.gamasutra.com/view/feature/131790/simple_intersection_tests_for_games.php?page=7
|
||||
F32 camera_to_near_clip_dist(LLViewerCamera::getInstance()->getNear());
|
||||
F32 min_camera_dist(min_near_clip_dist + camera_to_near_clip_dist);
|
||||
if (distance < min_camera_dist)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void FSAssetBlacklist::addNewItemToBlacklist(const LLUUID& id, const std::string
|
|||
return;
|
||||
}
|
||||
|
||||
LLDate curdate = LLDate(time_corrected());
|
||||
LLDate curdate = LLDate((double)time_corrected());
|
||||
std::string input_date = curdate.asString();
|
||||
input_date.replace(input_date.find("T"), 1, " ");
|
||||
input_date.resize(input_date.size() - 1);
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ public:
|
|||
if (mTime > 0) // have frame time
|
||||
{
|
||||
time_t current_time = time_corrected();
|
||||
time_t message_time = current_time - LLFrameTimer::getElapsedSeconds() + mTime;
|
||||
time_t message_time = (time_t)(current_time - LLFrameTimer::getElapsedSeconds() + mTime);
|
||||
|
||||
time_string = "[" + LLTrans::getString("TimeMonth") + "]/["
|
||||
+ LLTrans::getString("TimeDay") + "]/["
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ S32 FSCommon::secondsSinceEpochFromString(const std::string& format, const std::
|
|||
ss >> time_t_date;
|
||||
ptime time_t_epoch(date(1970,1,1));
|
||||
time_duration diff = time_t_date - time_t_epoch;
|
||||
return diff.total_seconds();
|
||||
return (S32)diff.total_seconds();
|
||||
}
|
||||
|
||||
void FSCommon::applyDefaultBuildPreferences(LLViewerObject* object)
|
||||
|
|
|
|||
|
|
@ -755,7 +755,7 @@ void FSData::saveLLSD(const LLSD& data, const std::string& filename, const LLDat
|
|||
}
|
||||
file.close();
|
||||
|
||||
const std::time_t new_time = last_modified.secondsSinceEpoch();
|
||||
const std::time_t new_time = (std::time_t)last_modified.secondsSinceEpoch();
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(filename)), new_time);
|
||||
|
|
|
|||
|
|
@ -2047,7 +2047,7 @@ void uploadCoroutine( LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &a_httpAdapter
|
|||
LL_INFOS() << "inventory_item_flags " << inventory_item_flags << LL_ENDL;
|
||||
}
|
||||
}
|
||||
S32 creation_date_now = time_corrected();
|
||||
S32 creation_date_now = (S32)time_corrected();
|
||||
|
||||
LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem( postContentResult[ "new_inventory_item" ].asUUID(), item_folder_id, new_perms, postContentResult[ "new_asset" ].asUUID(),
|
||||
asset_type, inventory_type, item_name, item_description, LLSaleInfo::DEFAULT, inventory_item_flags, creation_date_now );
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ void FSFloaterPerformance::draw()
|
|||
// Is our target frame time lower than current? If so we need to take action to reduce draw overheads.
|
||||
if (target_frame_time_ns <= tot_frame_time_ns)
|
||||
{
|
||||
U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns;
|
||||
U32 non_avatar_time_ns = (U32)(tot_frame_time_ns - tot_avatar_time_ns);
|
||||
// If the target frame time < non avatar frame time then we can pototentially reach it.
|
||||
if (non_avatar_time_ns < (U32)target_frame_time_ns)
|
||||
{
|
||||
|
|
@ -1126,15 +1126,15 @@ void FSFloaterPerformance::onExtendedAction(const LLSD& userdata, const LLUUID&
|
|||
if (camera_aspect < 1.0f || invert)
|
||||
{
|
||||
angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect());
|
||||
distance = width * 0.5 * 1.1 / tanf(angle_of_view * 0.5f);
|
||||
distance = width * 0.5f * 1.1f / tanf(angle_of_view * 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView());
|
||||
distance = height * 0.5 * 1.1 / tanf(angle_of_view * 0.5f);
|
||||
distance = height * 0.5f * 1.1f / tanf(angle_of_view * 0.5f);
|
||||
}
|
||||
|
||||
distance += depth * 0.5;
|
||||
distance += depth * 0.5f;
|
||||
|
||||
// Verify that the bounding box isn't inside the near clip. Using OBB-plane intersection to check if the
|
||||
// near-clip plane intersects with the bounding box, and if it does, adjust the distance such that the
|
||||
|
|
@ -1144,7 +1144,7 @@ void FSFloaterPerformance::onExtendedAction(const LLSD& userdata, const LLUUID&
|
|||
LLVector3d axis_y = LLVector3d(0, 1, 0) * bbox.getRotation();
|
||||
LLVector3d axis_z = LLVector3d(0, 0, 1) * bbox.getRotation();
|
||||
//Normal of nearclip plane is camera_dir.
|
||||
F32 min_near_clip_dist = bbox_extents.mdV[VX] * (camera_dir * axis_x) + bbox_extents.mdV[VY] * (camera_dir * axis_y) + bbox_extents.mdV[VZ] * (camera_dir * axis_z); // http://www.gamasutra.com/view/feature/131790/simple_intersection_tests_for_games.php?page=7
|
||||
F32 min_near_clip_dist = (F32)(bbox_extents.mdV[VX] * (camera_dir * axis_x) + bbox_extents.mdV[VY] * (camera_dir * axis_y) + bbox_extents.mdV[VZ] * (camera_dir * axis_z)); // http://www.gamasutra.com/view/feature/131790/simple_intersection_tests_for_games.php?page=7
|
||||
F32 camera_to_near_clip_dist(LLViewerCamera::getInstance()->getNear());
|
||||
F32 min_camera_dist(min_near_clip_dist + camera_to_near_clip_dist);
|
||||
if (distance < min_camera_dist)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ FSFloaterVoiceControls::FSFloaterVoiceControls(const LLSD& key)
|
|||
, mIsRlvShowNearbyRestricted(false)
|
||||
{
|
||||
static LLUICachedControl<S32> voice_left_remove_delay ("VoiceParticipantLeftRemoveDelay", 10);
|
||||
mSpeakerDelayRemover = new LLSpeakersDelayActionsStorage(boost::bind(&FSFloaterVoiceControls::removeVoiceLeftParticipant, this, _1), voice_left_remove_delay);
|
||||
mSpeakerDelayRemover = new LLSpeakersDelayActionsStorage(boost::bind(&FSFloaterVoiceControls::removeVoiceLeftParticipant, this, _1), (F32)voice_left_remove_delay);
|
||||
|
||||
LLVoiceClient::instance().addObserver(this);
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(this);
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ static std::string scopeript2(std::string& top, S32 fstart, char left = '{', cha
|
|||
|
||||
static inline S32 const_iterator_to_pos(std::string::const_iterator begin, std::string::const_iterator cursor)
|
||||
{
|
||||
return std::distance(begin, cursor);
|
||||
return (S32)std::distance(begin, cursor);
|
||||
}
|
||||
|
||||
static void shredder(std::string& text)
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ std::string FSMoneyTracker::getTime(time_t utc_time)
|
|||
|
||||
std::string FSMoneyTracker::getDate(time_t utc_time)
|
||||
{
|
||||
LLDate curdate = LLDate(utc_time);
|
||||
LLDate curdate = LLDate((double)utc_time);
|
||||
return curdate.asString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -888,23 +888,23 @@ U8 FSPanelFace::getCurrentDiffuseAlphaMode() { return (U8)mComboAlphaMod
|
|||
U8 FSPanelFace::getCurrentAlphaMaskCutoff() { return (U8)mCtrlMaskCutoff->getValue().asInteger(); }
|
||||
U8 FSPanelFace::getCurrentEnvIntensity() { return (U8)mCtrlEnvironment->getValue().asInteger(); }
|
||||
U8 FSPanelFace::getCurrentGlossiness() { return (U8)mCtrlGlossiness->getValue().asInteger(); }
|
||||
F32 FSPanelFace::getCurrentBumpyRot() { return mCtrlBumpyRot->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyScaleU() { return mCtrlBumpyScaleU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyScaleV() { return mCtrlBumpyScaleV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyOffsetU() { return mCtrlBumpyOffsetU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyOffsetV() { return mCtrlBumpyOffsetV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyRot() { return mCtrlShinyRot->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyScaleU() { return mCtrlShinyScaleU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyScaleV() { return mCtrlShinyScaleV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyOffsetU() { return mCtrlShinyOffsetU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyOffsetV() { return mCtrlShinyOffsetV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyRot() { return (F32)mCtrlBumpyRot->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyScaleU() { return (F32)mCtrlBumpyScaleU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyScaleV() { return (F32)mCtrlBumpyScaleV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyOffsetU() { return (F32)mCtrlBumpyOffsetU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentBumpyOffsetV() { return (F32)mCtrlBumpyOffsetV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyRot() { return (F32)mCtrlShinyRot->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyScaleU() { return (F32)mCtrlShinyScaleU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyScaleV() { return (F32)mCtrlShinyScaleV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyOffsetU() { return (F32)mCtrlShinyOffsetU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentShinyOffsetV() { return (F32)mCtrlShinyOffsetV->getValue().asReal(); }
|
||||
|
||||
// <FS:CR> UI provided diffuse parameters
|
||||
F32 FSPanelFace::getCurrentTextureRot() { return mCtrlTexRot->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureScaleU() { return mCtrlTexScaleU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureScaleV() { return mCtrlTexScaleV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureOffsetU() { return mCtrlTexOffsetU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureOffsetV() { return mCtrlTexOffsetV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureRot() { return (F32)mCtrlTexRot->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureScaleU() { return (F32)mCtrlTexScaleU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureScaleV() { return (F32)mCtrlTexScaleV->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureOffsetU() { return (F32)mCtrlTexOffsetU->getValue().asReal(); }
|
||||
F32 FSPanelFace::getCurrentTextureOffsetV() { return (F32)mCtrlTexOffsetV->getValue().asReal(); }
|
||||
// </FS:CR>
|
||||
|
||||
LLRender::eTexIndex FSPanelFace::getTextureChannelToEdit()
|
||||
|
|
@ -2182,8 +2182,8 @@ void FSPanelFace::updateUI(bool force_set_values /*false*/)
|
|||
calcp->setVar(LLCalc::TEX_U_OFFSET, getCurrentTextureOffsetU());
|
||||
calcp->setVar(LLCalc::TEX_V_OFFSET, getCurrentTextureOffsetV());
|
||||
calcp->setVar(LLCalc::TEX_ROTATION, getCurrentTextureRot());
|
||||
calcp->setVar(LLCalc::TEX_TRANSPARENCY, mCtrlColorTransp->getValue().asReal());
|
||||
calcp->setVar(LLCalc::TEX_GLOW, mCtrlGlow->getValue().asReal());
|
||||
calcp->setVar(LLCalc::TEX_TRANSPARENCY, (F32)mCtrlColorTransp->getValue().asReal());
|
||||
calcp->setVar(LLCalc::TEX_GLOW, (F32)mCtrlGlow->getValue().asReal());
|
||||
|
||||
// Find all faces with same texture
|
||||
// TODO: these were not yet added to the new texture panel -Zi
|
||||
|
|
@ -3394,7 +3394,7 @@ void FSPanelFace::getGLTFMaterial(LLGLTFMaterial* mat)
|
|||
|
||||
mat->mDoubleSided = mCheckDoubleSidedPBR->get();
|
||||
mat->setAlphaMode(mAlphaModePBR->getValue().asString());
|
||||
mat->mAlphaCutoff = mMaskCutoffPBR->getValue().asReal();
|
||||
mat->mAlphaCutoff = (F32)mMaskCutoffPBR->getValue().asReal();
|
||||
}
|
||||
|
||||
bool FSPanelFace::onDragPbr(LLInventoryItem* item)
|
||||
|
|
@ -4015,7 +4015,7 @@ void FSPanelFace::onCommitTextureScaleX()
|
|||
{
|
||||
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
|
||||
{
|
||||
F32 bumpy_scale_u = mCtrlTexScaleU->getValue().asReal();
|
||||
F32 bumpy_scale_u = (F32)mCtrlTexScaleU->getValue().asReal();
|
||||
if (isIdenticalPlanarTexgen())
|
||||
{
|
||||
bumpy_scale_u *= 0.5f;
|
||||
|
|
@ -4033,7 +4033,7 @@ void FSPanelFace::onCommitTextureScaleY()
|
|||
{
|
||||
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
|
||||
{
|
||||
F32 bumpy_scale_v = mCtrlTexScaleV->getValue().asReal();
|
||||
F32 bumpy_scale_v = (F32)mCtrlTexScaleV->getValue().asReal();
|
||||
if (isIdenticalPlanarTexgen())
|
||||
{
|
||||
bumpy_scale_v *= 0.5f;
|
||||
|
|
@ -4051,7 +4051,7 @@ void FSPanelFace::onCommitTextureRot()
|
|||
{
|
||||
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
|
||||
{
|
||||
syncMaterialRot(this, mCtrlTexRot->getValue().asReal());
|
||||
syncMaterialRot(this, (F32)mCtrlTexRot->getValue().asReal());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4065,7 +4065,7 @@ void FSPanelFace::onCommitTextureOffsetX()
|
|||
{
|
||||
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
|
||||
{
|
||||
syncOffsetX(this, mCtrlTexOffsetU->getValue().asReal());
|
||||
syncOffsetX(this, (F32)mCtrlTexOffsetU->getValue().asReal());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4078,7 +4078,7 @@ void FSPanelFace::onCommitTextureOffsetY()
|
|||
{
|
||||
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
|
||||
{
|
||||
syncOffsetY(this, mCtrlTexOffsetV->getValue().asReal());
|
||||
syncOffsetY(this, (F32)mCtrlTexOffsetV->getValue().asReal());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4103,7 +4103,7 @@ void FSPanelFace::onCommitRepeatsPerMeter()
|
|||
material_type = getCurrentMatChannel();
|
||||
}
|
||||
|
||||
F32 repeats_per_meter = mCtrlRpt->getValue().asReal();
|
||||
F32 repeats_per_meter = (F32)mCtrlRpt->getValue().asReal();
|
||||
|
||||
F32 obj_scale_s = 1.0f;
|
||||
F32 obj_scale_t = 1.0f;
|
||||
|
|
@ -5335,7 +5335,7 @@ void FSPanelFace::onCommitGLTFUVSpinner(const LLUICtrl* ctrl, const LLSD& user_d
|
|||
const S32 pbr_channel = types[user_data.asString()];
|
||||
|
||||
const std::string& spinner_name = ctrl->getName();
|
||||
const float value = ctrl->getValue().asReal();
|
||||
const float value = (float)ctrl->getValue().asReal();
|
||||
|
||||
if (LLStringUtil::startsWith(spinner_name, "gltfTextureScaleU"))
|
||||
{
|
||||
|
|
@ -5706,13 +5706,13 @@ void FSPanelFace::alignMaterialsProperties()
|
|||
//<FS:TS> FIRE-12275: Material offset not working correctly
|
||||
// Since the server cannot store negative offsets for materials
|
||||
// textures, we normalize them to equivalent positive values here.
|
||||
tex_offset_u = (tex_offset_u < 0.0) ? 1.0 + tex_offset_u : tex_offset_u;
|
||||
tex_offset_v = (tex_offset_v < 0.0) ? 1.0 + tex_offset_v : tex_offset_v;
|
||||
tex_offset_u = (tex_offset_u < 0.0f) ? 1.0f + tex_offset_u : tex_offset_u;
|
||||
tex_offset_v = (tex_offset_v < 0.0f) ? 1.0f + tex_offset_v : tex_offset_v;
|
||||
//</FS:TS> FIRE-12275
|
||||
|
||||
//<FS:TS> FIRE-12831: Negative rotations revert to zero
|
||||
// The same goes for rotations as for offsets.
|
||||
tex_rot = (tex_rot < 0.0) ? 360.0 + tex_rot : tex_rot;
|
||||
tex_rot = (tex_rot < 0.0f) ? 360.0f + tex_rot : tex_rot;
|
||||
//</FS:TS> FIRE-12831
|
||||
|
||||
mCtrlShinyScaleU->setValue(tex_scale_u);
|
||||
|
|
@ -5758,7 +5758,7 @@ void FSPanelFace::onCommitFlip(const LLSD& user_data)
|
|||
if (spinner)
|
||||
{
|
||||
// TODO: compensate for normal/specular map doubling of values in planar mapping mode -Zi
|
||||
F32 value = -(spinner->getValue().asReal());
|
||||
F32 value = -(F32)(spinner->getValue().asReal());
|
||||
spinner->setValue(value);
|
||||
spinner->forceEditorCommit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,8 +190,8 @@ void FSRadar::updateRadarList()
|
|||
FSLSLBridge& bridge = FSLSLBridge::instance();
|
||||
|
||||
LFSimFeatureHandler& simfeaturehandler = LFSimFeatureHandler::instance();
|
||||
const F32 chat_range_say = simfeaturehandler.sayRange();
|
||||
const F32 chat_range_shout = simfeaturehandler.shoutRange();
|
||||
const F32 chat_range_say = (F32)simfeaturehandler.sayRange();
|
||||
const F32 chat_range_shout = (F32)simfeaturehandler.shoutRange();
|
||||
|
||||
static const std::string str_chat_entering = LLTrans::getString("entering_chat_range");
|
||||
static const std::string str_chat_leaving = LLTrans::getString("leaving_chat_range");
|
||||
|
|
@ -351,7 +351,7 @@ void FSRadar::updateRadarList()
|
|||
}
|
||||
S32 avAge = ent->mAge;
|
||||
std::string avName = ent->mName;
|
||||
U32 lastZOffsetTime = ent->mLastZOffsetTime;
|
||||
U32 lastZOffsetTime = (U32)ent->mLastZOffsetTime;
|
||||
F32 avZOffset = ent->mZOffset;
|
||||
if (avPos[VZ] == AVATAR_UNKNOWN_Z_OFFSET) // if our official z position is AVATAR_UNKNOWN_Z_OFFSET, we need a correction.
|
||||
{
|
||||
|
|
@ -368,7 +368,7 @@ void FSRadar::updateRadarList()
|
|||
ent->mLastZOffsetTime = now;
|
||||
}
|
||||
}
|
||||
F32 avRange = (avPos[VZ] != AVATAR_UNKNOWN_Z_OFFSET ? dist_vec(avPos, posSelf) : AVATAR_UNKNOWN_RANGE);
|
||||
F32 avRange = (F32)(avPos[VZ] != AVATAR_UNKNOWN_Z_OFFSET ? dist_vec(avPos, posSelf) : AVATAR_UNKNOWN_RANGE);
|
||||
ent->mRange = avRange;
|
||||
ent->mGlobalPos = avPos;
|
||||
ent->mRegion = avRegion;
|
||||
|
|
@ -682,7 +682,7 @@ void FSRadar::updateRadarList()
|
|||
|
||||
// clear out the dispatch queue
|
||||
mRadarOffsetRequests.clear();
|
||||
mRadarLastBulkOffsetRequestTime = now;
|
||||
mRadarLastBulkOffsetRequestTime = (U32)now;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue