merge changes for 3.7.30-release

master
Oz Linden 2015-06-15 15:53:45 -04:00
commit 95fc2d48ec
241 changed files with 3056 additions and 1662 deletions

View File

@ -499,3 +499,7 @@ bc61801f614022c920cb5c3df1d7d67a9561ce1f 3.7.22-release
d3d0101e980ec95043e0af9b7903045d3bc447e4 3.7.24-release
9978a8c3a2ffce4a5e1c186256581c2ac139c9dc 3.7.25-release
000e9dda4162cbf0a83ba88558b19473654a09a9 3.7.26-release
afd8d4756e8eda3c8f760625d1c17a2ad40ad6c8 3.7.27-release
566874eb5ab26c003ef7fb0e22ce40c5fa0013f4 3.7.28-release
d07f76c5b9860fb87924d00ca729f7d4532534d6 3.7.29-release
67edc442c80b8d2fadd2a6c4a7184b469906cdbf 3.7.30-release

View File

@ -327,6 +327,7 @@ Cinder Roxley
STORM-2036
STORM-2037
STORM-2053
STORM-2113
Clara Young
Coaldust Numbers
VWR-1095
@ -1233,6 +1234,7 @@ Sovereign Engineer
MAINT-2334
OPEN-189
STORM-1972
STORM-2113
OPEN-195
OPEN-217
OPEN-295

View File

@ -70,76 +70,87 @@ if(WINDOWS)
# Copy MS C runtime dlls, required for packaging.
# *TODO - Adapt this to support VC9
if (MSVC80)
set(MSVC_VER 80)
set(MSVC_VERDOT 8.0)
list(APPEND LMSVC_VER 80)
list(APPEND LMSVC_VERDOT 8.0)
elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
set(MSVC_VER 100)
set(MSVC_VERDOT 10.0)
MESSAGE(STATUS "MSVC_VERSION ${MSVC_VERSION}")
elseif (MSVC_VERSION EQUAL 1800) # VisualStudio 2013, which is (sigh) VS 12
set(MSVC_VER 120)
set(MSVC_VERDOT 12.0)
list(APPEND LMSVC_VER 120)
list(APPEND LMSVC_VERDOT 12.0)
else (MSVC80)
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
endif (MSVC80)
FIND_PATH(debug_msvc_redist_path msvcr${MSVC_VER}d.dll
PATHS
${MSVC_DEBUG_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC${MSVC_VER}.DebugCRT
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
NO_DEFAULT_PATH
)
if(EXISTS ${debug_msvc_redist_path})
set(debug_msvc_files
msvcr${MSVC_VER}d.dll
msvcp${MSVC_VER}d.dll
# try to copy VS2010 redist independently of system version
list(APPEND LMSVC_VER 100)
list(APPEND LMSVC_VERDOT 10.0)
list(LENGTH LMSVC_VER count)
math(EXPR count "${count}-1")
foreach(i RANGE ${count})
list(GET LMSVC_VER ${i} MSVC_VER)
list(GET LMSVC_VERDOT ${i} MSVC_VERDOT)
MESSAGE(STATUS "Copying redist libs for VC ${MSVC_VERDOT}")
FIND_PATH(debug_msvc_redist_path NAME msvcr${MSVC_VER}d.dll
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC${MSVC_VER}.DebugCRT
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
${MSVC_DEBUG_REDIST_PATH}
NO_DEFAULT_PATH
)
copy_if_different(
${debug_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
if(EXISTS ${debug_msvc_redist_path})
set(debug_msvc_files
msvcr${MSVC_VER}d.dll
msvcp${MSVC_VER}d.dll
)
endif ()
copy_if_different(
${debug_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
FIND_PATH(release_msvc_redist_path msvcr${MSVC_VER}.dll
PATHS
${MSVC_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_VER}.CRT
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
NO_DEFAULT_PATH
)
unset(debug_msvc_redist_path CACHE)
endif()
if(EXISTS ${release_msvc_redist_path})
set(release_msvc_files
msvcr${MSVC_VER}.dll
msvcp${MSVC_VER}.dll
FIND_PATH(release_msvc_redist_path NAME msvcr${MSVC_VER}.dll
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_VER}.CRT
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
${MSVC_REDIST_PATH}
NO_DEFAULT_PATH
)
copy_if_different(
${release_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${release_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
if(EXISTS ${release_msvc_redist_path})
set(release_msvc_files
msvcr${MSVC_VER}.dll
msvcp${MSVC_VER}.dll
)
copy_if_different(
${release_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${release_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endif ()
copy_if_different(
${release_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${release_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${release_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
unset(release_msvc_redist_path CACHE)
endif()
endforeach()
elseif(DARWIN)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")

View File

@ -88,7 +88,7 @@ LLAssetType::EType LLWearable::getAssetType() const
BOOL LLWearable::exportFile(const std::string& filename) const
{
llofstream ofs(filename, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
return ofs.is_open() && exportStream(ofs);
}
@ -204,7 +204,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
LLWearable::EImportResult LLWearable::importFile(const std::string& filename,
LLAvatarAppearance* avatarp )
{
llifstream ifs(filename, std::ios_base::in | std::ios_base::binary);
llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary);
return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp);
}

View File

@ -92,7 +92,7 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL
}
}
U32 LLWearableData::pushWearable(const LLWearableType::EType type,
void LLWearableData::pushWearable(const LLWearableType::EType type,
LLWearable *wearable,
bool trigger_updated /* = true */)
{
@ -100,9 +100,8 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
{
// no null wearables please!
LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL;
return MAX_CLOTHING_PER_TYPE;
}
if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE)
if (canAddWearable(type))
{
mWearableDatas[type].push_back(wearable);
if (trigger_updated)
@ -110,9 +109,7 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
const BOOL removed = FALSE;
wearableUpdated(wearable, removed);
}
return mWearableDatas[type].size()-1;
}
return MAX_CLOTHING_PER_TYPE;
}
// virtual
@ -125,7 +122,7 @@ void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed)
}
}
void LLWearableData::popWearable(LLWearable *wearable)
void LLWearableData::eraseWearable(LLWearable *wearable)
{
if (wearable == NULL)
{
@ -133,16 +130,16 @@ void LLWearableData::popWearable(LLWearable *wearable)
return;
}
U32 index = getWearableIndex(wearable);
const LLWearableType::EType type = wearable->getType();
if (index < MAX_CLOTHING_PER_TYPE && index < getWearableCount(type))
U32 index;
if (getWearableIndex(wearable,index))
{
popWearable(type, index);
eraseWearable(type, index);
}
}
void LLWearableData::popWearable(const LLWearableType::EType type, U32 index)
void LLWearableData::eraseWearable(const LLWearableType::EType type, U32 index)
{
LLWearable *wearable = getWearable(type, index);
if (wearable)
@ -204,11 +201,11 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type)
}
U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const
BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const
{
if (wearable == NULL)
{
return MAX_CLOTHING_PER_TYPE;
return FALSE;
}
const LLWearableType::EType type = wearable->getType();
@ -216,18 +213,50 @@ U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const
if (wearable_iter == mWearableDatas.end())
{
LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
return MAX_CLOTHING_PER_TYPE;
return FALSE;
}
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
for(U32 index = 0; index < wearable_vec.size(); index++)
{
if (wearable_vec[index] == wearable)
{
return index;
index_found = index;
return TRUE;
}
}
return MAX_CLOTHING_PER_TYPE;
return FALSE;
}
U32 LLWearableData::getClothingLayerCount() const
{
U32 count = 0;
for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
{
LLWearableType::EType type = (LLWearableType::EType)i;
if (LLWearableType::getAssetType(type)==LLAssetType::AT_CLOTHING)
{
count += getWearableCount(type);
}
}
return count;
}
BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const
{
LLAssetType::EType a_type = LLWearableType::getAssetType(type);
if (a_type==LLAssetType::AT_CLOTHING)
{
return (getClothingLayerCount() < MAX_CLOTHING_LAYERS);
}
else if (a_type==LLAssetType::AT_BODYPART)
{
return (getWearableCount(type) < 1);
}
else
{
return FALSE;
}
}
BOOL LLWearableData::isOnTop(LLWearable* wearable) const

14
indra/llappearance/llwearabledata.h Normal file → Executable file
View File

@ -60,11 +60,13 @@ public:
const LLWearable* getBottomWearable(const LLWearableType::EType type) const;
U32 getWearableCount(const LLWearableType::EType type) const;
U32 getWearableCount(const U32 tex_index) const;
U32 getWearableIndex(const LLWearable *wearable) const;
BOOL getWearableIndex(const LLWearable *wearable, U32& index) const;
U32 getClothingLayerCount() const;
BOOL canAddWearable(const LLWearableType::EType type) const;
BOOL isOnTop(LLWearable* wearable) const;
static const U32 MAX_CLOTHING_PER_TYPE = 5;
static const U32 MAX_CLOTHING_LAYERS = 60;
//--------------------------------------------------------------------
// Setters
@ -72,11 +74,11 @@ public:
protected:
// Low-level data structure setter - public access is via setWearableItem, etc.
void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable);
U32 pushWearable(const LLWearableType::EType type, LLWearable *wearable,
void pushWearable(const LLWearableType::EType type, LLWearable *wearable,
bool trigger_updated = true);
virtual void wearableUpdated(LLWearable *wearable, BOOL removed);
void popWearable(LLWearable *wearable);
void popWearable(const LLWearableType::EType type, U32 index);
void eraseWearable(LLWearable *wearable);
void eraseWearable(const LLWearableType::EType type, U32 index);
void clearWearableType(const LLWearableType::EType type);
bool swapWearables(const LLWearableType::EType type, U32 index_a, U32 index_b);

9
indra/llappearance/llwearabletype.cpp Normal file → Executable file
View File

@ -27,6 +27,7 @@
#include "linden_common.h"
#include "llwearabletype.h"
#include "llinventorytype.h"
#include "llinventorydefines.h"
static LLTranslationBridge* sTrans = NULL;
@ -160,7 +161,7 @@ BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
return entry->mDisableCameraSwitch;
}
// static
// static
BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
{
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
@ -169,3 +170,9 @@ BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
return entry->mAllowMultiwear;
}
// static
LLWearableType::EType LLWearableType::inventoryFlagsToWearableType(U32 flags)
{
return (LLWearableType::EType)(flags & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
}

1
indra/llappearance/llwearabletype.h Normal file → Executable file
View File

@ -80,6 +80,7 @@ public:
static LLInventoryType::EIconName getIconName(EType type);
static BOOL getDisableCameraSwitch(EType type);
static BOOL getAllowMultiwear(EType type);
static EType inventoryFlagsToWearableType(U32 flags);
protected:
LLWearableType() {}

View File

@ -361,7 +361,6 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str
}
updatePos(av_info);
}
}
//--------------------------------------------------------------------

View File

@ -64,22 +64,18 @@ protected:
public:
// Constructor
LLJointState()
{
mUsage = 0;
mJoint = NULL;
mUsage = 0;
mWeight = 0.f;
mPriority = LLJoint::USE_MOTION_PRIORITY;
}
: mUsage(0)
, mJoint(NULL)
, mWeight(0.f)
, mPriority(LLJoint::USE_MOTION_PRIORITY)
{}
LLJointState(LLJoint* joint)
{
mUsage = 0;
mJoint = joint;
mUsage = 0;
mWeight = 0.f;
mPriority = LLJoint::USE_MOTION_PRIORITY;
}
: mUsage(0)
, mJoint(joint)
, mWeight(0.f)
, mPriority(LLJoint::USE_MOTION_PRIORITY)
{}
// joint that this state is applied to
LLJoint* getJoint() { return mJoint; }

View File

@ -113,7 +113,7 @@ namespace {
public:
RecordToFile(const std::string& filename)
{
mFile.open(filename, llofstream::out | llofstream::app);
mFile.open(filename.c_str(), std::ios_base::out | std::ios_base::app);
if (!mFile)
{
LL_INFOS() << "Error setting log file to " << filename << LL_ENDL;
@ -335,7 +335,7 @@ namespace
LLSD configuration;
{
llifstream file(filename());
llifstream file(filename().c_str());
if (file.is_open())
{
LLSDSerialize::fromXML(configuration, file);

View File

@ -424,26 +424,6 @@ LLFILE * LLFile::_Fiopen(const std::string& filename,
/************** llstdio file buffer ********************************/
//llstdio_filebuf* llstdio_filebuf::open(const char *_Filename,
// ios_base::openmode _Mode)
//{
//#if LL_WINDOWS
// _Filet *_File;
// if (is_open() || (_File = LLFILE::_Fiopen(_Filename, _Mode)) == 0)
// return (0); // open failed
//
// _Init(_File, _Openfl);
// _Initcvt(&_USE(_Mysb::getloc(), _Cvt));
// return (this); // open succeeded
//#else
// std::filebuf* _file = std::filebuf::open(_Filename, _Mode);
// if (NULL == _file) return NULL;
// return this;
//#endif
//}
// *TODO: Seek the underlying c stream for better cross-platform compatibility?
#if !LL_WINDOWS
llstdio_filebuf::int_type llstdio_filebuf::overflow(llstdio_filebuf::int_type __c)
{
@ -865,23 +845,19 @@ int llstdio_filebuf::sync()
}
#endif
#if LL_WINDOWS
/************** input file stream ********************************/
llifstream::llifstream() : _M_filebuf(),
#if LL_WINDOWS
std::istream(&_M_filebuf) {}
#else
std::istream()
llifstream::llifstream() :
_M_filebuf(),
std::istream(&_M_filebuf)
{
this->init(&_M_filebuf);
}
#endif
// explicit
llifstream::llifstream(const std::string& _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::istream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -890,18 +866,11 @@ llifstream::llifstream(const std::string& _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::istream()
{
this->init(&_M_filebuf);
this->open(_Filename.c_str(), _Mode | ios_base::in);
}
#endif
// explicit
llifstream::llifstream(const char* _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::istream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -910,40 +879,6 @@ llifstream::llifstream(const char* _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::istream()
{
this->init(&_M_filebuf);
this->open(_Filename, _Mode | ios_base::in);
}
#endif
#if llstream_LLFILE
// explicit
llifstream::llifstream(_Filet *_File,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(_File, _Mode, _Size),
#if LL_WINDOWS
std::istream(&_M_filebuf) {}
#else
std::istream()
{
this->init(&_M_filebuf);
}
#endif
#if !LL_WINDOWS
// explicit
llifstream::llifstream(int __fd,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(__fd, _Mode, _Size),
std::istream()
{
this->init(&_M_filebuf);
}
#endif
#endif // llstream_LLFILE
bool llifstream::is_open() const
{ // test if C stream has been opened
@ -952,8 +887,6 @@ bool llifstream::is_open() const
void llifstream::open(const char* _Filename, ios_base::openmode _Mode)
{ // open a C stream with specified mode
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::in) == 0)
{
@ -963,27 +896,13 @@ void llifstream::open(const char* _Filename, ios_base::openmode _Mode)
{
_Myios::clear();
}
#else
if (_M_filebuf.open(_Filename, _Mode | ios_base::in) == 0)
{
this->setstate(ios_base::failbit);
}
else
{
this->clear();
}
#endif
}
void llifstream::close()
{ // close the C stream
if (_M_filebuf.close() == 0)
{
#if LL_WINDOWS
_Myios::setstate(ios_base::failbit);
#else
this->setstate(ios_base::failbit);
#endif
}
}
@ -991,20 +910,16 @@ void llifstream::close()
/************** output file stream ********************************/
llofstream::llofstream() : _M_filebuf(),
#if LL_WINDOWS
std::ostream(&_M_filebuf) {}
#else
std::ostream()
llofstream::llofstream() :
_M_filebuf(),
std::ostream(&_M_filebuf)
{
this->init(&_M_filebuf);
}
#endif
// explicit
llofstream::llofstream(const std::string& _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::ostream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -1013,18 +928,11 @@ llofstream::llofstream(const std::string& _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::ostream()
{
this->init(&_M_filebuf);
this->open(_Filename.c_str(), _Mode | ios_base::out);
}
#endif
// explicit
llofstream::llofstream(const char* _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::ostream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -1033,39 +941,6 @@ llofstream::llofstream(const char* _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::ostream()
{
this->init(&_M_filebuf);
this->open(_Filename, _Mode | ios_base::out);
}
#endif
#if llstream_LLFILE
// explicit
llofstream::llofstream(_Filet *_File,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(_File, _Mode, _Size),
#if LL_WINDOWS
std::ostream(&_M_filebuf) {}
#else
std::ostream()
{
this->init(&_M_filebuf);
}
#endif
#if !LL_WINDOWS
// explicit
llofstream::llofstream(int __fd,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(__fd, _Mode, _Size),
std::ostream()
{
this->init(&_M_filebuf);
}
#endif
#endif // llstream_LLFILE
bool llofstream::is_open() const
{ // test if C stream has been opened
@ -1074,7 +949,6 @@ bool llofstream::is_open() const
void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
{ // open a C stream with specified mode
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
{
@ -1084,27 +958,13 @@ void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
{
_Myios::clear();
}
#else
if (_M_filebuf.open(_Filename, _Mode | ios_base::out) == 0)
{
this->setstate(ios_base::failbit);
}
else
{
this->clear();
}
#endif
}
void llofstream::close()
{ // close the C stream
if (_M_filebuf.close() == 0)
{
#if LL_WINDOWS
_Myios::setstate(ios_base::failbit);
#else
this->setstate(ios_base::failbit);
#endif
}
}
@ -1134,4 +994,4 @@ std::streamsize llofstream_size(llofstream& ofstr)
return pos_end - pos_beg;
}
#endif // LL_WINDOWS

View File

@ -86,12 +86,6 @@ public:
static const char * tmpdir();
};
// Remove ll[io]fstream support for [LL]FILE*, preparing to remove dependency
// on GNU's standard library.
#if ! defined(llstream_LLFILE)
#define llstream_LLFILE 0
#endif
/**
* @brief Provides a layer of compatibility for C/POSIX.
*
@ -198,7 +192,7 @@ protected:
#endif
};
#if LL_WINDOWS
/**
* @brief Controlling input for files.
*
@ -207,11 +201,11 @@ protected:
* sequence, an instance of std::basic_filebuf (or a platform-specific derivative)
* which allows construction using a pre-exisintg file stream buffer.
* We refer to this std::basic_filebuf (or derivative) as @c sb.
*/
*/
class LL_COMMON_API llifstream : public std::istream
{
// input stream associated with a C stream
public:
public:
// Constructors:
/**
* @brief Default constructor.
@ -219,7 +213,7 @@ public:
* Initializes @c sb using its default constructor, and passes
* @c &sb to the base class initializer. Does not open any files
* (you haven't given it a filename to open).
*/
*/
llifstream();
/**
@ -228,50 +222,21 @@ public:
* @param Mode Open file in specified mode (see std::ios_base).
*
* @c ios_base::in is automatically included in @a mode.
*/
*/
explicit llifstream(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::in);
ios_base::openmode _Mode = ios_base::in);
explicit llifstream(const char* _Filename,
ios_base::openmode _Mode = ios_base::in);
#if llstream_LLFILE
/**
* @brief Create a stream using an open c file stream.
* @param File An open @c FILE*.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
explicit llifstream(_Filet *_File,
ios_base::openmode _Mode = ios_base::in,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
/**
* @brief Create a stream using an open file descriptor.
* @param fd An open file descriptor.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
#if !LL_WINDOWS
explicit llifstream(int __fd,
ios_base::openmode _Mode = ios_base::in,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
#endif
#endif // llstream_LLFILE
ios_base::openmode _Mode = ios_base::in);
/**
* @brief The destructor does nothing.
*
* The file is closed by the filebuf object, not the formatting
* stream.
*/
*/
virtual ~llifstream() {}
// Members:
#if llstream_LLFILE
/**
* @brief Accessing the underlying buffer.
* @return The current basic_filebuf buffer.
@ -280,12 +245,11 @@ public:
*/
llstdio_filebuf* rdbuf() const
{ return const_cast<llstdio_filebuf*>(&_M_filebuf); }
#endif // llstream_LLFILE
/**
* @brief Wrapper to test for an open file.
* @return @c rdbuf()->is_open()
*/
*/
bool is_open() const;
/**
@ -295,22 +259,22 @@ public:
*
* Calls @c llstdio_filebuf::open(s,mode|in). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void open(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::in)
ios_base::openmode _Mode = ios_base::in)
{ open(_Filename.c_str(), _Mode); }
void open(const char* _Filename,
ios_base::openmode _Mode = ios_base::in);
ios_base::openmode _Mode = ios_base::in);
/**
* @brief Close the file.
*
* Calls @c llstdio_filebuf::close(). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void close();
private:
private:
llstdio_filebuf _M_filebuf;
};
@ -326,7 +290,7 @@ private:
*/
class LL_COMMON_API llofstream : public std::ostream
{
public:
public:
// Constructors:
/**
* @brief Default constructor.
@ -334,7 +298,7 @@ public:
* Initializes @c sb using its default constructor, and passes
* @c &sb to the base class initializer. Does not open any files
* (you haven't given it a filename to open).
*/
*/
llofstream();
/**
@ -344,39 +308,11 @@ public:
*
* @c ios_base::out|ios_base::trunc is automatically included in
* @a mode.
*/
*/
explicit llofstream(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
explicit llofstream(const char* _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
#if llstream_LLFILE
/**
* @brief Create a stream using an open c file stream.
* @param File An open @c FILE*.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
explicit llofstream(_Filet *_File,
ios_base::openmode _Mode = ios_base::out,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
/**
* @brief Create a stream using an open file descriptor.
* @param fd An open file descriptor.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
#if !LL_WINDOWS
explicit llofstream(int __fd,
ios_base::openmode _Mode = ios_base::out,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
#endif
#endif // llstream_LLFILE
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
/**
* @brief The destructor does nothing.
@ -387,7 +323,6 @@ public:
virtual ~llofstream() {}
// Members:
#if llstream_LLFILE
/**
* @brief Accessing the underlying buffer.
* @return The current basic_filebuf buffer.
@ -396,7 +331,6 @@ public:
*/
llstdio_filebuf* rdbuf() const
{ return const_cast<llstdio_filebuf*>(&_M_filebuf); }
#endif // llstream_LLFILE
/**
* @brief Wrapper to test for an open file.
@ -411,22 +345,22 @@ public:
*
* Calls @c llstdio_filebuf::open(s,mode|out). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void open(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc)
ios_base::openmode _Mode = ios_base::out|ios_base::trunc)
{ open(_Filename.c_str(), _Mode); }
void open(const char* _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
/**
* @brief Close the file.
*
* Calls @c llstdio_filebuf::close(). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void close();
private:
private:
llstdio_filebuf _M_filebuf;
};
@ -441,4 +375,12 @@ private:
std::streamsize LL_COMMON_API llifstream_size(llifstream& fstr);
std::streamsize LL_COMMON_API llofstream_size(llofstream& fstr);
#else // ! LL_WINDOWS
// on non-windows, llifstream and llofstream are just mapped directly to the std:: equivalents
typedef std::ifstream llifstream;
typedef std::ofstream llofstream;
#endif // LL_WINDOWS or ! LL_WINDOWS
#endif // not LL_LLFILE_H

View File

@ -49,7 +49,7 @@ bool LLLiveAppConfig::loadFile()
{
LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from "
<< filename() << LL_ENDL;
llifstream file(filename());
llifstream file(filename().c_str());
LLSD config;
if (file.is_open())
{

View File

@ -51,6 +51,8 @@ public:
bool mLastExists;
LLEventTimer* mEventTimer;
private:
LOG_CLASS(LLLiveFile);
};
LLLiveFile::Impl::Impl(const std::string& filename, const F32 refresh_period)
@ -83,46 +85,51 @@ LLLiveFile::~LLLiveFile()
bool LLLiveFile::Impl::check()
{
if (!mForceCheck && mRefreshTimer.getElapsedTimeF32() < mRefreshPeriod)
bool detected_change = false;
// Skip the check if not enough time has elapsed and we're not
// forcing a check of the file
if (mForceCheck || mRefreshTimer.getElapsedTimeF32() >= mRefreshPeriod)
{
// Skip the check if not enough time has elapsed and we're not
// forcing a check of the file
return false;
}
mForceCheck = false;
mRefreshTimer.reset();
mForceCheck = false; // force only forces one check
mRefreshTimer.reset(); // don't check again until mRefreshPeriod has passed
// Stat the file to see if it exists and when it was last modified.
llstat stat_data;
int res = LLFile::stat(mFilename, &stat_data);
if (res)
{
// Couldn't stat the file, that means it doesn't exist or is
// broken somehow. Clear flags and return.
if (mLastExists)
{
mLastExists = false;
return true; // no longer existing is a change!
}
return false;
}
// The file exists, decide if we want to load it.
if (mLastExists)
{
// The file existed last time, don't read it if it hasn't changed since
// last time.
if (stat_data.st_mtime <= mLastModTime)
{
return false;
}
}
// We want to read the file. Update status info for the file.
mLastExists = true;
mLastStatTime = stat_data.st_mtime;
return true;
// Stat the file to see if it exists and when it was last modified.
llstat stat_data;
if (LLFile::stat(mFilename, &stat_data))
{
// Couldn't stat the file, that means it doesn't exist or is
// broken somehow.
if (mLastExists)
{
mLastExists = false;
detected_change = true; // no longer existing is a change!
LL_DEBUGS() << "detected deleted file '" << mFilename << "'" << LL_ENDL;
}
}
else
{
// The file exists
if ( ! mLastExists )
{
// last check, it did not exist - that counts as a change
LL_DEBUGS() << "detected created file '" << mFilename << "'" << LL_ENDL;
detected_change = true;
}
else if ( stat_data.st_mtime > mLastModTime )
{
// file modification time is newer than last check
LL_DEBUGS() << "detected updated file '" << mFilename << "'" << LL_ENDL;
detected_change = true;
}
mLastExists = true;
mLastStatTime = stat_data.st_mtime;
}
}
if (detected_change)
{
LL_INFOS() << "detected file change '" << mFilename << "'" << LL_ENDL;
}
return detected_change;
}
void LLLiveFile::Impl::changed()

View File

@ -118,6 +118,12 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) {
buffer_space = 64 - buffer_index; // how much space is left in buffer
// now, transform each 64-byte piece of the input, bypassing the buffer
if (input == NULL || input_length == 0){
std::cerr << "LLMD5::update: Invalid input!" << std::endl;
return;
}
// Transform as many times as possible.
if (input_length >= buffer_space) { // ie. we have enough to fill the buffer
// fill the rest of the buffer and transform
@ -127,12 +133,6 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) {
buffer_space);
transform (buffer);
// now, transform each 64-byte piece of the input, bypassing the buffer
if (input == NULL || input_length == 0){
std::cerr << "LLMD5::update: Invalid input!" << std::endl;
return;
}
for (input_index = buffer_space; input_index + 63 < input_length;
input_index += 64)
transform (input+input_index);

View File

@ -63,13 +63,18 @@ LLPrivateMemoryPoolManager::mem_allocation_info_t LLPrivateMemoryPoolManager::sM
void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
{
#ifdef SHOW_ASSERT
// Redundant, place to set breakpoints.
if (ptr%alignment!=0)
{
LL_WARNS() << "alignment check failed" << LL_ENDL;
}
llassert(ptr%alignment==0);
#if defined(LL_WINDOWS) && defined(LL_DEBUG_BUFFER_OVERRUN)
//do not check
return;
#else
#ifdef SHOW_ASSERT
// Redundant, place to set breakpoints.
if (ptr%alignment!=0)
{
LL_WARNS() << "alignment check failed" << LL_ENDL;
}
llassert(ptr%alignment==0);
#endif
#endif
}
@ -2148,3 +2153,60 @@ void LLPrivateMemoryPoolTester::fragmentationtest()
}
#endif
//--------------------------------------------------------------------
#if defined(LL_WINDOWS) && defined(LL_DEBUG_BUFFER_OVERRUN)
#include <map>
struct mem_info {
std::map<void*, void*> memory_info;
LLMutex mutex;
static mem_info& get() {
static mem_info instance;
return instance;
}
private:
mem_info(){}
};
void* ll_aligned_malloc_fallback( size_t size, int align )
{
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
unsigned int for_alloc = sysinfo.dwPageSize;
while(for_alloc < size) for_alloc += sysinfo.dwPageSize;
void *p = VirtualAlloc(NULL, for_alloc+sysinfo.dwPageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
if(NULL == p) {
// call debugger
__asm int 3;
}
DWORD old;
BOOL Res = VirtualProtect((void*)((char*)p + for_alloc), sysinfo.dwPageSize, PAGE_NOACCESS, &old);
if(FALSE == Res) {
// call debugger
__asm int 3;
}
void* ret = (void*)((char*)p + for_alloc-size);
{
LLMutexLock lock(&mem_info::get().mutex);
mem_info::get().memory_info.insert(std::pair<void*, void*>(ret, p));
}
return ret;
}
void ll_aligned_free_fallback( void* ptr )
{
LLMutexLock lock(&mem_info::get().mutex);
VirtualFree(mem_info::get().memory_info.find(ptr)->second, 0, MEM_RELEASE);
mem_info::get().memory_info.erase(ptr);
}
#endif

View File

@ -94,32 +94,44 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16)
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
// for enable buffer overrun detection predefine LL_DEBUG_BUFFER_OVERRUN in current library
// change preprocessro code to: #if 1 && defined(LL_WINDOWS)
inline void* ll_aligned_malloc_fallback( size_t size, int align )
{
#if defined(LL_WINDOWS)
return _aligned_malloc(size, align);
#if 0 && defined(LL_WINDOWS)
void* ll_aligned_malloc_fallback( size_t size, int align );
void ll_aligned_free_fallback( void* ptr );
//------------------------------------------------------------------------------------------------
#else
void* mem = malloc( size + (align - 1) + sizeof(void*) );
char* aligned = ((char*)mem) + sizeof(void*);
aligned += align - ((uintptr_t)aligned & (align - 1));
((void**)aligned)[-1] = mem;
return aligned;
#endif
}
inline void ll_aligned_free_fallback( void* ptr )
{
#if defined(LL_WINDOWS)
_aligned_free(ptr);
#else
if (ptr)
inline void* ll_aligned_malloc_fallback( size_t size, int align )
{
free( ((void**)ptr)[-1] );
#if defined(LL_WINDOWS)
return _aligned_malloc(size, align);
#else
void* mem = malloc( size + (align - 1) + sizeof(void*) );
char* aligned = ((char*)mem) + sizeof(void*);
aligned += align - ((uintptr_t)aligned & (align - 1));
((void**)aligned)[-1] = mem;
return aligned;
#endif
}
inline void ll_aligned_free_fallback( void* ptr )
{
#if defined(LL_WINDOWS)
_aligned_free(ptr);
#else
if (ptr)
{
free( ((void**)ptr)[-1] );
}
#endif
}
#endif
}
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
#if !LL_USE_TCMALLOC
inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed with ll_aligned_free_16().

View File

@ -125,6 +125,30 @@ bool ll_get_stack_trace(std::vector<std::string>& lines)
return false;
}
void ll_get_stack_trace_internal(std::vector<std::string>& lines)
{
const S32 MAX_STACK_DEPTH = 100;
const S32 STRING_NAME_LENGTH = 256;
HANDLE process = GetCurrentProcess();
SymInitialize( process, NULL, TRUE );
void *stack[MAX_STACK_DEPTH];
unsigned short frames = RtlCaptureStackBackTrace_fn( 0, MAX_STACK_DEPTH, stack, NULL );
SYMBOL_INFO *symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + STRING_NAME_LENGTH * sizeof(char), 1);
symbol->MaxNameLen = STRING_NAME_LENGTH-1;
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
for(unsigned int i = 0; i < frames; i++)
{
SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol);
lines.push_back(symbol->Name);
}
free( symbol );
}
#else
bool ll_get_stack_trace(std::vector<std::string>& lines)
@ -132,5 +156,10 @@ bool ll_get_stack_trace(std::vector<std::string>& lines)
return false;
}
void ll_get_stack_trace_internal(std::vector<std::string>& lines)
{
}
#endif

View File

@ -33,6 +33,7 @@
#include <string>
LL_COMMON_API bool ll_get_stack_trace(std::vector<std::string>& lines);
LL_COMMON_API void ll_get_stack_trace_internal(std::vector<std::string>& lines);
#endif

View File

@ -107,7 +107,7 @@ bool iswindividual(llwchar elem)
bool _read_file_into_string(std::string& str, const std::string& filename)
{
llifstream ifs(filename, llifstream::binary);
llifstream ifs(filename.c_str(), llifstream::binary);
if (!ifs.is_open())
{
LL_INFOS() << "Unable to open file " << filename << LL_ENDL;

View File

@ -29,7 +29,7 @@
#include "linden_common.h"
#include "lluriparser.h"
LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mRes(0)
LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedTmp(false), mRes(0)
{
mState.uri = &mUri;
@ -118,17 +118,20 @@ void LLUriParser::fragment(const std::string& s)
void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
{
S32 len = textRange.afterLast - textRange.first;
if (len)
if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast)
{
str = textRange.first;
str = str.substr(0, len);
const ptrdiff_t len = textRange.afterLast - textRange.first;
str.assign(textRange.first, static_cast<std::string::size_type>(len));
}
else
{
str = LLStringUtil::null;
}
}
void LLUriParser::extractParts()
{
if (mTmpScheme)
if (mTmpScheme || mNormalizedTmp)
{
mScheme.clear();
}
@ -157,6 +160,7 @@ void LLUriParser::extractParts()
S32 LLUriParser::normalize()
{
mNormalizedTmp = mTmpScheme;
if (!mRes)
{
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
@ -175,29 +179,58 @@ S32 LLUriParser::normalize()
if (!mRes)
{
mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0];
mTmpScheme = false;
}
}
}
}
if(mTmpScheme)
{
mNormalizedUri = mNormalizedUri.substr(7);
mTmpScheme = false;
}
return mRes;
}
void LLUriParser::glue(std::string& uri) const
{
std::string first_part;
glueFirst(first_part);
std::string second_part;
glueSecond(second_part);
uri = first_part + second_part;
}
void LLUriParser::glueFirst(std::string& uri) const
{
if (mScheme.size())
{
uri = mScheme;
uri += "://";
}
else
{
uri.clear();
}
uri += mHost;
}
void LLUriParser::glueSecond(std::string& uri) const
{
if (mPort.size())
{
uri += ':';
uri = ':';
uri += mPort;
}
else
{
uri.clear();
}
uri += mPath;

View File

@ -36,7 +36,7 @@ class LL_COMMON_API LLUriParser
{
public:
LLUriParser(const std::string& u);
virtual ~LLUriParser();
~LLUriParser();
const char * scheme() const;
void sheme (const std::string& s);
@ -60,6 +60,8 @@ public:
void extractParts();
void glue(std::string& uri) const;
void glueFirst(std::string& uri) const;
void glueSecond(std::string& uri) const;
bool test() const;
S32 normalize();
@ -79,6 +81,7 @@ private:
S32 mRes;
bool mTmpScheme;
bool mNormalizedTmp;
};
#endif // LL_LLURIPARSER_H

View File

@ -106,7 +106,7 @@ LLSD LLCrashLock::getLockFile(std::string filename)
{
LLSD lock_sd = LLSD::emptyMap();
llifstream ifile(filename);
llifstream ifile(filename.c_str());
if (ifile.is_open())
{
@ -120,7 +120,7 @@ LLSD LLCrashLock::getLockFile(std::string filename)
bool LLCrashLock::putLockFile(std::string filename, const LLSD& data)
{
bool result = true;
llofstream ofile(filename);
llofstream ofile(filename.c_str());
if (!LLSDSerialize::toXML(data,ofile))
{

View File

@ -1172,7 +1172,7 @@ static std::string find_file(std::string &name, S8 *codec)
for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++)
{
tname = name + "." + std::string(file_extensions[i].exten);
llifstream ifs(tname, llifstream::binary);
llifstream ifs(tname.c_str(), llifstream::binary);
if (ifs.is_open())
{
ifs.close();
@ -1219,7 +1219,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
return false; // format not recognized
}
llifstream ifs(name, llifstream::binary);
llifstream ifs(name.c_str(), llifstream::binary);
if (!ifs.is_open())
{
// SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam

View File

@ -54,7 +54,7 @@ LLImageFilter::LLImageFilter(const std::string& file_path) :
mStencilMax(1.0)
{
// Load filter description from file
llifstream filter_xml(file_path);
llifstream filter_xml(file_path.c_str());
if (filter_xml.is_open())
{
// Load and parse the file

View File

@ -143,7 +143,8 @@ bool LLImageDecodeThread::ImageRequest::processRequest()
mFormattedImage->getComponents());
}
done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // 1ms
mDecodedRaw = done;
// some decoders are removing data when task is complete and there were errors
mDecodedRaw = done && mDecodedImageRaw->getData();
}
if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull())
{
@ -155,7 +156,7 @@ bool LLImageDecodeThread::ImageRequest::processRequest()
1);
}
done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms
mDecodedAux = done;
mDecodedAux = done && mDecodedImageAux->getData();
}
return done;

View File

@ -67,6 +67,8 @@ LLImageRaw::~LLImageRaw() { }
void LLImageRaw::deleteData() { }
U8* LLImageRaw::allocateData(S32 size) { return NULL; }
U8* LLImageRaw::reallocateData(S32 size) { return NULL; }
const U8* LLImageBase::getData() const { return NULL; }
U8* LLImageBase::getData() { return NULL; }
// End Stubbing
// -------------------------------------------------------------------------------------------

View File

@ -248,8 +248,8 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list)
// compute the starting step-size
F32 minimum_radius = 0.5f * llmin(diagonal.mV[VX], llmin(diagonal.mV[VY], diagonal.mV[VZ]));
F32 step_length = bounding_radius - minimum_radius;
S32 step_count = 0;
S32 max_step_count = 12;
//S32 step_count = 0;
//S32 max_step_count = 12;
F32 half_milimeter = 0.0005f;
// wander the center around in search of tighter solutions
@ -258,7 +258,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list)
S32 last_dz = 2;
while (step_length > half_milimeter
&& step_count < max_step_count)
/*&& step_count < max_step_count*/)
{
// the algorithm for testing the maximum radius could be expensive enough
// that it makes sense to NOT duplicate testing when possible, so we keep

View File

@ -2683,6 +2683,17 @@ void LLVolume::setMeshAssetLoaded(BOOL loaded)
mIsMeshAssetLoaded = loaded;
}
void LLVolume::copyFacesTo(std::vector<LLVolumeFace> &faces) const
{
faces = mVolumeFaces;
}
void LLVolume::copyFacesFrom(const std::vector<LLVolumeFace> &faces)
{
mVolumeFaces = faces;
mSculptLevel = 0;
}
void LLVolume::copyVolumeFaces(const LLVolume* volume)
{
mVolumeFaces = volume->mVolumeFaces;
@ -5964,7 +5975,10 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
}
else
{ //degenerate, make up a value
normal.set(0,0,1);
if(normal.getF32ptr()[2] >= 0)
normal.set(0.f,0.f,1.f);
else
normal.set(0.f,0.f,-1.f);
}
llassert(llfinite(normal.getF32ptr()[0]));
@ -6278,6 +6292,8 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
num_vertices = mNumS*mNumT;
num_indices = (mNumS-1)*(mNumT-1)*6;
partial_build = (num_vertices > mNumVertices || num_indices > mNumIndices) ? FALSE : partial_build;
if (!partial_build)
{
resizeVertices(num_vertices);

View File

@ -993,6 +993,7 @@ public:
void resizePath(S32 length);
const LLAlignedArray<LLVector4a,64>& getMesh() const { return mMesh; }
const LLVector4a& getMeshPt(const U32 i) const { return mMesh[i]; }
void setDirty() { mPathp->setDirty(); mProfilep->setDirty(); }
@ -1045,6 +1046,8 @@ public:
void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level);
void copyVolumeFaces(const LLVolume* volume);
void copyFacesTo(std::vector<LLVolumeFace> &faces) const;
void copyFacesFrom(const std::vector<LLVolumeFace> &faces);
void cacheOptimize();
private:

View File

@ -355,9 +355,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
if (!url.empty())
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested "
<< ids << " ids"
<< LL_ENDL;
LL_INFOS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability getting " << ids << " ids" << LL_ENDL;
LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids));
}
}
@ -381,8 +379,7 @@ void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id,
const std::string& full_name,
bool is_group)
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameFetch "
<< "agent " << agent_id << " "
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache agent " << agent_id << " "
<< "full name '" << full_name << "'"
<< ( is_group ? " [group]" : "" )
<< LL_ENDL;
@ -411,7 +408,7 @@ void LLAvatarNameCache::requestNamesViaLegacy()
// invoked below. This should never happen in practice.
sPendingQueue[agent_id] = now;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL;
LL_DEBUGS("AvNameCache") << "agent " << agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3));
@ -429,12 +426,13 @@ void LLAvatarNameCache::cleanupClass()
sCache.clear();
}
void LLAvatarNameCache::importFile(std::istream& istr)
bool LLAvatarNameCache::importFile(std::istream& istr)
{
LLSD data;
if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr))
{
return;
LL_WARNS("AvNameCache") << "avatar name cache data xml parse failed" << LL_ENDL;
return false;
}
// by convention LLSD storage is a map
@ -450,17 +448,19 @@ void LLAvatarNameCache::importFile(std::istream& istr)
av_name.fromLLSD( it->second );
sCache[agent_id] = av_name;
}
LL_INFOS("AvNameCache") << "loaded " << sCache.size() << LL_ENDL;
LL_INFOS("AvNameCache") << "LLAvatarNameCache loaded " << sCache.size() << LL_ENDL;
// Some entries may have expired since the cache was stored,
// but they will be flushed in the first call to eraseUnrefreshed
// from LLAvatarNameResponder::idle
return true;
}
void LLAvatarNameCache::exportFile(std::ostream& ostr)
{
LLSD agents;
F64 max_unrefreshed = LLFrameTimer::getTotalSeconds() - MAX_UNREFRESHED_TIME;
LL_INFOS("AvNameCache") << "LLAvatarNameCache at exit cache has " << sCache.size() << LL_ENDL;
cache_t::const_iterator it = sCache.begin();
for ( ; it != sCache.end(); ++it)
{
@ -473,6 +473,7 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr)
agents[agent_id.asString()] = av_name.asLLSD();
}
}
LL_INFOS("AvNameCache") << "LLAvatarNameCache returning " << agents.size() << LL_ENDL;
LLSD data;
data["agents"] = agents;
LLSDSerialize::toPrettyXML(data, ostr);
@ -515,6 +516,7 @@ void LLAvatarNameCache::idle()
}
else
{
LL_WARNS_ONCE("AvNameCache") << "LLAvatarNameCache still using legacy api" << LL_ENDL;
requestNamesViaLegacy();
}
}
@ -552,24 +554,26 @@ void LLAvatarNameCache::eraseUnrefreshed()
if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed)
{
sLastExpireCheck = now;
S32 expired = 0;
for (cache_t::iterator it = sCache.begin(); it != sCache.end();)
{
const LLAvatarName& av_name = it->second;
if (av_name.mExpires < max_unrefreshed)
{
LL_DEBUGS("AvNameCache") << it->first
LL_DEBUGS("AvNameCacheExpired") << "LLAvatarNameCache " << it->first
<< " user '" << av_name.getAccountName() << "' "
<< "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL;
sCache.erase(it++);
expired++;
}
else
{
++it;
}
}
LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL;
LL_INFOS("AvNameCache") << "LLAvatarNameCache expired " << expired << " cached avatar names, "
<< sCache.size() << " remaining" << LL_ENDL;
}
}
@ -590,8 +594,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
{
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "refresh agent " << agent_id
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache refresh agent " << agent_id
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
@ -603,9 +606,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "queue request for agent " << agent_id
<< LL_ENDL;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache queue request for agent " << agent_id << LL_ENDL;
sAskQueue.insert(agent_id);
}
@ -734,7 +735,7 @@ bool LLAvatarNameCache::expirationFromCacheControl(const LLSD& headers, F64 *exp
fromCacheControl = true;
}
}
LL_DEBUGS("AvNameCache")
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache "
<< ( fromCacheControl ? "expires based on cache control " : "default expiration " )
<< "in " << *expires - now << " seconds"
<< LL_ENDL;

View File

@ -46,7 +46,7 @@ namespace LLAvatarNameCache
void cleanupClass();
// Import/export the name cache to file.
void importFile(std::istream& istr);
bool importFile(std::istream& istr);
void exportFile(std::ostream& ostr);
// On the viewer, usually a simulator capabilitity.

View File

@ -103,6 +103,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
mPeakBPSOut(0.f),
mPeriodTime(0.0),
mExistenceTimer(),
mAckCreationTime(0.f),
mCurrentResendCount(0),
mLastPacketGap(0),
mHeartbeatInterval(circuit_heartbeat_interval),
@ -1078,60 +1079,69 @@ BOOL LLCircuitData::collectRAck(TPACKETID packet_num)
}
mAcks.push_back(packet_num);
if (mAckCreationTime == 0)
{
mAckCreationTime = getAgeInSeconds();
}
return TRUE;
}
// this method is called during the message system processAcks() to
// send out any acks that did not get sent already.
void LLCircuit::sendAcks()
void LLCircuit::sendAcks(F32 collect_time)
{
collect_time = llclamp(collect_time, 0.f, LL_COLLECT_ACK_TIME_MAX);
LLCircuitData* cd;
circuit_data_map::iterator end = mSendAckMap.end();
for(circuit_data_map::iterator it = mSendAckMap.begin(); it != end; ++it)
circuit_data_map::iterator it = mSendAckMap.begin();
while (it != mSendAckMap.end())
{
cd = (*it).second;
circuit_data_map::iterator cur_it = it++;
cd = (*cur_it).second;
S32 count = (S32)cd->mAcks.size();
if(count > 0)
F32 age = cd->getAgeInSeconds() - cd->mAckCreationTime;
if (age > collect_time || count == 0)
{
// send the packet acks
S32 acks_this_packet = 0;
for(S32 i = 0; i < count; ++i)
if (count>0)
{
if(acks_this_packet == 0)
// send the packet acks
S32 acks_this_packet = 0;
for(S32 i = 0; i < count; ++i)
{
gMessageSystem->newMessageFast(_PREHASH_PacketAck);
if(acks_this_packet == 0)
{
gMessageSystem->newMessageFast(_PREHASH_PacketAck);
}
gMessageSystem->nextBlockFast(_PREHASH_Packets);
gMessageSystem->addU32Fast(_PREHASH_ID, cd->mAcks[i]);
++acks_this_packet;
if(acks_this_packet > 250)
{
gMessageSystem->sendMessage(cd->mHost);
acks_this_packet = 0;
}
}
gMessageSystem->nextBlockFast(_PREHASH_Packets);
gMessageSystem->addU32Fast(_PREHASH_ID, cd->mAcks[i]);
++acks_this_packet;
if(acks_this_packet > 250)
if(acks_this_packet > 0)
{
gMessageSystem->sendMessage(cd->mHost);
acks_this_packet = 0;
}
}
if(acks_this_packet > 0)
{
gMessageSystem->sendMessage(cd->mHost);
}
if(gMessageSystem->mVerboseLog)
{
std::ostringstream str;
str << "MSG: -> " << cd->mHost << "\tPACKET ACKS:\t";
std::ostream_iterator<TPACKETID> append(str, " ");
std::copy(cd->mAcks.begin(), cd->mAcks.end(), append);
LL_INFOS() << str.str() << LL_ENDL;
}
if(gMessageSystem->mVerboseLog)
{
std::ostringstream str;
str << "MSG: -> " << cd->mHost << "\tPACKET ACKS:\t";
std::ostream_iterator<TPACKETID> append(str, " ");
std::copy(cd->mAcks.begin(), cd->mAcks.end(), append);
LL_INFOS() << str.str() << LL_ENDL;
}
// empty out the acks list
cd->mAcks.clear();
// empty out the acks list
cd->mAcks.clear();
cd->mAckCreationTime = 0.f;
}
// remove data map
mSendAckMap.erase(cur_it);
}
}
// All acks have been sent, clear the map
mSendAckMap.clear();
}

View File

@ -60,6 +60,7 @@ const U8 LL_PACKET_ID_SIZE = 6;
const S32 LL_MAX_RESENT_PACKETS_PER_FRAME = 100;
const S32 LL_MAX_ACKED_PACKETS_PER_FRAME = 200;
const F32 LL_COLLECT_ACK_TIME_MAX = 2.f;
//
// Prototypes and Predefines
@ -237,6 +238,7 @@ protected:
packet_time_map mPotentialLostPackets;
packet_time_map mRecentlyReceivedReliablePackets;
std::vector<TPACKETID> mAcks;
F32 mAckCreationTime; // first ack creation time
typedef std::map<TPACKETID, LLReliablePacket *> reliable_map;
typedef reliable_map::iterator reliable_iter;
@ -302,7 +304,7 @@ public:
// this method is called during the message system processAcks()
// to send out any acks that did not get sent already.
void sendAcks();
void sendAcks(F32 collect_time);
friend std::ostream& operator<<(std::ostream& s, LLCircuit &circuit);
void getInfo(LLSD& info) const;
@ -333,6 +335,7 @@ protected:
circuit_data_map mCircuitData;
typedef std::set<LLCircuitData *, LLCircuitData::less> ping_set_t; // Circuits sorted by next ping time
ping_set_t mPingSet;
// This variable points to the last circuit data we found to

View File

@ -157,7 +157,7 @@ namespace
{
LLBufferStream ostream(channels, buffer.get());
llifstream fstream(mFilename, std::iostream::binary | std::iostream::out);
llifstream fstream(mFilename.c_str(), std::iostream::binary | std::iostream::out);
if(fstream.is_open())
{
fstream.seekg(0, std::ios::end);

View File

@ -96,7 +96,7 @@ bool LLMessageConfigFile::loadFile()
{
LLSD data;
{
llifstream file(filename());
llifstream file(filename().c_str());
if (file.is_open())
{

View File

@ -34,7 +34,7 @@
void LLServiceBuilder::loadServiceDefinitionsFromFile(
const std::string& service_filename)
{
llifstream service_file(service_filename, std::ios::binary);
llifstream service_file(service_filename.c_str(), std::ios::binary);
if(service_file.is_open())
{
LLSD service_data;

View File

@ -787,7 +787,7 @@ S32 LLMessageSystem::getReceiveBytes() const
}
void LLMessageSystem::processAcks()
void LLMessageSystem::processAcks(F32 collect_time)
{
F64Seconds mt_sec = getMessageTimeSeconds();
{
@ -813,7 +813,7 @@ void LLMessageSystem::processAcks()
mCircuitInfo.resendUnackedPackets(mUnackedListDepth, mUnackedListSize);
//cycle through ack list for each host we need to send acks to
mCircuitInfo.sendAcks();
mCircuitInfo.sendAcks(collect_time);
if (!mDenyTrustedCircuitSet.empty())
{

View File

@ -331,7 +331,7 @@ public:
BOOL poll(F32 seconds); // Number of seconds that we want to block waiting for data, returns if data was received
BOOL checkMessages( S64 frame_count = 0 );
void processAcks();
void processAcks(F32 collect_time = 0.f);
BOOL isMessageFast(const char *msg);
BOOL isMessage(const char *msg)

View File

@ -1681,11 +1681,11 @@ LLSD LLModel::writeModel(
}
}
F32* src_tc = (F32*) face.mTexCoords[j].mV;
//texcoord
if (face.mTexCoords)
{
F32* src_tc = (F32*) face.mTexCoords[j].mV;
for (U32 k = 0; k < 2; ++k)
{ //for each component
//convert to 16-bit normalized
@ -2012,7 +2012,7 @@ bool LLModel::loadModel(std::istream& is)
}
}
std::string nm[] =
static const std::string nm[] =
{
"lowest_lod",
"low_lod",

View File

@ -322,6 +322,11 @@ S32 LLPrimitive::setTEMaterialParams(const U8 index, const LLMaterialPtr pMateri
return mTextureList.setMaterialParams(index, pMaterialParams);
}
LLMaterialPtr LLPrimitive::getTEMaterialParams(const U8 index)
{
return mTextureList.getMaterialParams(index);
}
//===============================================================
S32 LLPrimitive::setTEBumpShinyFullbright(const U8 index, const U8 bump)
{
@ -1356,9 +1361,8 @@ S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec)
retval |= setTEBumpShinyFullbright(i, tec.bump[i]);
retval |= setTEMediaTexGen(i, tec.media_flags[i]);
retval |= setTEGlow(i, (F32)tec.glow[i] / (F32)0xFF);
retval |= setTEMaterialID(i, tec.material_ids[i]);
retval |= setTEMaterialID(i, tec.material_ids[i]);
coloru = LLColor4U(tec.colors + 4*i);
// Note: This is an optimization to send common colors (1.f, 1.f, 1.f, 1.f)

View File

@ -389,6 +389,8 @@ public:
virtual BOOL setMaterial(const U8 material); // returns TRUE if material changed
virtual void setTESelected(const U8 te, bool sel);
LLMaterialPtr getTEMaterialParams(const U8 index);
void copyTEs(const LLPrimitive *primitive);
S32 packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const;
S32 unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 data_size, U8 face_count, EMsgVariableType type);

View File

@ -377,6 +377,16 @@ S32 LLPrimTextureList::setMaterialParams(const U8 index, const LLMaterialPtr pMa
return TEM_CHANGE_NONE;
}
LLMaterialPtr LLPrimTextureList::getMaterialParams(const U8 index)
{
if (index < mEntryList.size())
{
return mEntryList[index]->getMaterialParams();
}
return LLMaterialPtr();
}
S32 LLPrimTextureList::size() const
{
return mEntryList.size();

View File

@ -107,6 +107,8 @@ public:
S32 setMaterialID(const U8 index, const LLMaterialID& pMaterialID);
S32 setMaterialParams(const U8 index, const LLMaterialPtr pMaterialParams);
LLMaterialPtr getMaterialParams(const U8 index);
S32 size() const;
// void forceResize(S32 new_size);

View File

@ -69,6 +69,7 @@ const U32 FLAGS_TEMPORARY_ON_REZ = (1U << 29);
//const U32 FLAGS_UNUSED_007 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED
const U32 FLAGS_LOCAL = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE;
const U32 FLAGS_WORLD = FLAGS_USE_PHYSICS | FLAGS_PHANTOM | FLAGS_TEMPORARY_ON_REZ;
typedef enum e_havok_joint_type
{

View File

@ -53,7 +53,7 @@ bool LLRender::sGLCoreProfile = false;
static const U32 LL_NUM_TEXTURE_LAYERS = 32;
static const U32 LL_NUM_LIGHT_UNITS = 8;
static GLenum sGLTextureType[] =
static const GLenum sGLTextureType[] =
{
GL_TEXTURE_2D,
GL_TEXTURE_RECTANGLE_ARB,
@ -61,14 +61,14 @@ static GLenum sGLTextureType[] =
GL_TEXTURE_2D_MULTISAMPLE
};
static GLint sGLAddressMode[] =
static const GLint sGLAddressMode[] =
{
GL_REPEAT,
GL_MIRRORED_REPEAT,
GL_CLAMP_TO_EDGE
};
static GLenum sGLCompareFunc[] =
static const GLenum sGLCompareFunc[] =
{
GL_NEVER,
GL_ALWAYS,
@ -82,7 +82,7 @@ static GLenum sGLCompareFunc[] =
const U32 immediate_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0;
static GLenum sGLBlendFactor[] =
static const GLenum sGLBlendFactor[] =
{
GL_ONE,
GL_ZERO,
@ -99,12 +99,12 @@ static GLenum sGLBlendFactor[] =
};
LLTexUnit::LLTexUnit(S32 index)
: mCurrTexType(TT_NONE), mCurrBlendType(TB_MULT),
mCurrColorOp(TBO_MULT), mCurrAlphaOp(TBO_MULT),
mCurrColorSrc1(TBS_TEX_COLOR), mCurrColorSrc2(TBS_PREV_COLOR),
mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA),
mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0),
mHasMipMaps(false)
: mCurrTexType(TT_NONE), mCurrBlendType(TB_MULT),
mCurrColorOp(TBO_MULT), mCurrAlphaOp(TBO_MULT),
mCurrColorSrc1(TBS_TEX_COLOR), mCurrColorSrc2(TBS_PREV_COLOR),
mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA),
mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0),
mHasMipMaps(false)
{
llassert_always(index < (S32)LL_NUM_TEXTURE_LAYERS);
mIndex = index;
@ -1189,7 +1189,7 @@ void LLRender::syncMatrices()
if (shader)
{
llassert(shader);
//llassert(shader);
bool mvp_done = false;
@ -1288,7 +1288,7 @@ void LLRender::syncMatrices()
}
else if (!LLGLSLShader::sNoFixedFunction)
{
GLenum mode[] =
static const GLenum mode[] =
{
GL_MODELVIEW,
GL_PROJECTION,

View File

@ -170,7 +170,8 @@ LLFolderView::LLFolderView(const Params& p)
mDraggingOverItem(NULL),
mStatusTextBox(NULL),
mShowItemLinkOverlays(p.show_item_link_overlays),
mViewModel(p.view_model)
mViewModel(p.view_model),
mGroupedItemModel(p.grouped_item_model)
{
claimMem(mViewModel);
LLPanel* panel = p.parent_panel;
@ -1610,7 +1611,7 @@ void LLFolderView::update()
LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter();
if (filter_object.isModified() && filter_object.isNotDefault())
if (filter_object.isModified() && filter_object.isNotDefault() && mParentPanel.get()->getVisible())
{
mNeedsAutoSelect = TRUE;
}
@ -1652,8 +1653,10 @@ void LLFolderView::update()
scrollToShowSelection();
}
BOOL filter_finished = getViewModelItem()->passedFilter()
&& mViewModel->contentsReady();
BOOL filter_finished = mViewModel->contentsReady()
&& (getViewModelItem()->passedFilter()
|| ( getViewModelItem()->getLastFilterGeneration() >= filter_object.getFirstSuccessGeneration()
&& !filter_object.isModified()));
if (filter_finished
|| gFocusMgr.childHasKeyboardFocus(mParentPanel.get())
|| gFocusMgr.childHasMouseCapture(mParentPanel.get()))
@ -1808,7 +1811,6 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
}
// Successively filter out invalid options
U32 multi_select_flag = (mSelectedItems.size() > 1 ? ITEM_IN_MULTI_SELECTION : 0x0);
U32 flags = multi_select_flag | FIRST_SELECTED_ITEM;
for (selected_items_t::iterator item_itor = mSelectedItems.begin();
@ -1820,6 +1822,14 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
flags = multi_select_flag;
}
// This adds a check for restrictions based on the entire
// selection set - for example, any one wearable may not push you
// over the limit, but all wearables together still might.
if (getFolderViewGroupedItemModel())
{
getFolderViewGroupedItemModel()->groupFilterContextMenu(mSelectedItems,*menu);
}
addNoOptions(menu);
}

View File

@ -45,6 +45,7 @@
#include "llscrollcontainer.h"
class LLFolderViewModelInterface;
class LLFolderViewGroupedItemModel;
class LLFolderViewFolder;
class LLFolderViewItem;
class LLFolderViewFilter;
@ -93,6 +94,7 @@ public:
use_ellipses,
show_item_link_overlays;
Mandatory<LLFolderViewModelInterface*> view_model;
Optional<LLFolderViewGroupedItemModel*> grouped_item_model;
Mandatory<std::string> options_menu;
@ -100,7 +102,7 @@ public:
};
friend class LLFolderViewScrollContainer;
typedef std::deque<LLFolderViewItem*> selected_items_t;
typedef folder_view_item_deque selected_items_t;
LLFolderView(const Params&);
virtual ~LLFolderView( void );
@ -113,6 +115,9 @@ public:
LLFolderViewModelInterface* getFolderViewModel() { return mViewModel; }
const LLFolderViewModelInterface* getFolderViewModel() const { return mViewModel; }
LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() { return mGroupedItemModel; }
const LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() const { return mGroupedItemModel; }
typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t;
void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); }
void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); }
@ -300,6 +305,7 @@ protected:
LLHandle<LLPanel> mParentPanel;
LLFolderViewModelInterface* mViewModel;
LLFolderViewGroupedItemModel* mGroupedItemModel;
/**
* Is used to determine if we need to cut text In LLFolderViewItem to avoid horizontal scroll.

7
indra/llui/llfolderviewitem.h Normal file → Executable file
View File

@ -454,5 +454,12 @@ public:
template<typename SORT_FUNC> void sortItems(const SORT_FUNC& func) { mItems.sort(func); }
};
typedef std::deque<LLFolderViewItem*> folder_view_item_deque;
class LLFolderViewGroupedItemModel: public LLRefCount
{
public:
virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) = 0;
};
#endif // LLFOLDERVIEWITEM_H

View File

@ -3689,7 +3689,7 @@ BOOL LLMenuHolderGL::handleKey(KEY key, MASK mask, BOOL called_from_parent)
{
handled = pMenu->handleKey(key, mask, TRUE);
}
else
else if (mask == MASK_NONE || (key >= KEY_LEFT && key <= KEY_DOWN))
{
//highlight first enabled one
if(pMenu->highlightNextItem(NULL))

View File

@ -1825,6 +1825,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
return TRUE;
}
}
return LLUICtrl::handleRightMouseDown(x, y, mask);
}
return FALSE;
}

View File

@ -144,12 +144,14 @@ void LLSpellChecker::refreshDictionaryMap()
const std::string user_path = getDictionaryUserPath();
// Load dictionary information (file name, friendly name, ...)
llifstream user_file(user_path + DICT_FILE_MAIN, std::ios::binary);
std::string user_filename(user_path + DICT_FILE_MAIN);
llifstream user_file(user_filename.c_str(), std::ios::binary);
if ( (!user_file.is_open())
|| (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, user_file))
|| (0 == sDictMap.size()) )
{
llifstream app_file(app_path + DICT_FILE_MAIN, std::ios::binary);
std::string app_filename(app_path + DICT_FILE_MAIN);
llifstream app_file(app_filename.c_str(), std::ios::binary);
if ( (!app_file.is_open())
|| (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, app_file))
|| (0 == sDictMap.size()) )
@ -159,7 +161,7 @@ void LLSpellChecker::refreshDictionaryMap()
}
// Load user installed dictionary information
llifstream custom_file(user_path + DICT_FILE_USER, std::ios::binary);
llifstream custom_file(user_filename.c_str(), std::ios::binary);
if (custom_file.is_open())
{
LLSD custom_dict_map;
@ -215,7 +217,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri
if (gDirUtilp->fileExists(dict_path))
{
llifstream file_in(dict_path, std::ios::in);
llifstream file_in(dict_path.c_str(), std::ios::in);
if (file_in.is_open())
{
std::string word; int line_num = 0;
@ -238,7 +240,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri
word_list.push_back(word);
llofstream file_out(dict_path, std::ios::out | std::ios::trunc);
llofstream file_out(dict_path.c_str(), std::ios::out | std::ios::trunc);
if (file_out.is_open())
{
file_out << word_list.size() << std::endl;
@ -352,7 +354,7 @@ void LLSpellChecker::initHunspell(const std::string& dict_language)
if (gDirUtilp->fileExists(user_path + DICT_FILE_IGNORE))
{
llifstream file_in(user_path + DICT_FILE_IGNORE, std::ios::in);
llifstream file_in((user_path + DICT_FILE_IGNORE).c_str(), std::ios::in);
if (file_in.is_open())
{
std::string word; int idxLine = 0;
@ -463,7 +465,8 @@ void LLSpellChecker::removeDictionary(const std::string& dict_language)
LLSD LLSpellChecker::loadUserDictionaryMap()
{
LLSD dict_map;
llifstream dict_file(getDictionaryUserPath() + DICT_FILE_USER, std::ios::binary);
std::string dict_filename(getDictionaryUserPath() + DICT_FILE_USER);
llifstream dict_file(dict_filename.c_str(), std::ios::binary);
if (dict_file.is_open())
{
LLSDSerialize::fromXMLDocument(dict_map, dict_file);
@ -475,7 +478,7 @@ LLSD LLSpellChecker::loadUserDictionaryMap()
// static
void LLSpellChecker::saveUserDictionaryMap(const LLSD& dict_map)
{
llofstream dict_file(getDictionaryUserPath() + DICT_FILE_USER, std::ios::trunc);
llofstream dict_file((getDictionaryUserPath() + DICT_FILE_USER).c_str(), std::ios::trunc);
if (dict_file.is_open())
{
LLSDSerialize::toPrettyXML(dict_map, dict_file);

View File

@ -38,7 +38,6 @@
#include "lltextutil.h"
#include "lltooltip.h"
#include "lluictrl.h"
#include "lluriparser.h"
#include "llurlaction.h"
#include "llurlregistry.h"
#include "llview.h"
@ -2063,8 +2062,16 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted());
// output the styled Url
//appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly());
appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly());
// show query part of url with gray color only for LLUrlEntryHTTP and LLUrlEntryHTTPNoProtocol url entries
std::string label = match.getQuery();
if (label.size())
{
link_params.color = LLColor4::grey;
link_params.readonly_color = LLColor4::grey;
appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly());
}
// set the tooltip for the Url label
if (! match.getTooltip().empty())
@ -2855,13 +2862,44 @@ void LLTextBase::updateRects()
needsReflow();
}
// update mTextBoundingRect after mVisibleTextRect took scrolls into account
if (!mLineInfoList.empty() && mScroller)
{
S32 delta_pos = 0;
switch(mVAlign)
{
case LLFontGL::TOP:
delta_pos = llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom);
break;
case LLFontGL::VCENTER:
delta_pos = (llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2;
break;
case LLFontGL::BOTTOM:
delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom;
break;
case LLFontGL::BASELINE:
// do nothing
break;
}
// move line segments to fit new visible rect
if (delta_pos != 0)
{
for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it)
{
it->mRect.translate(0, delta_pos);
}
mTextBoundingRect.translate(0, delta_pos);
}
}
// update document container again, using new mVisibleTextRect (that has scrollbars enabled as needed)
doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom);
doc_rect.mLeft = 0;
doc_rect.mRight = mScroller
? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight)
: mVisibleTextRect.getWidth();
doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop);
doc_rect.mTop = llmax(mVisibleTextRect.getHeight(), mTextBoundingRect.getHeight()) + doc_rect.mBottom;
if (!mScroller)
{
// push doc rect to top of text widget

View File

@ -814,7 +814,7 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL handled = FALSE;
// if I'm not currently selecting text
if (!(hasSelection() && hasMouseCapture()))
if (!(mIsSelecting && hasMouseCapture()))
{
// let text segments handle mouse event
handled = LLTextBase::handleMouseUp(x, y, mask);
@ -2448,12 +2448,30 @@ void LLTextEditor::updateLinkSegments()
LLTextSegment *segment = *it;
if (segment && segment->getStyle() && segment->getStyle()->isLink())
{
// if the link's label (what the user can edit) is a valid Url,
// then update the link's HREF to be the same as the label text.
// This lets users edit Urls in-place.
LLStyleConstSP style = segment->getStyle();
LLStyleSP new_style(new LLStyle(*style));
LLWString url_label = wtext.substr(segment->getStart(), segment->getEnd()-segment->getStart());
segment_set_t::const_iterator next_it = mSegments.upper_bound(segment);
LLTextSegment *next_segment = *next_it;
if (next_segment)
{
LLWString next_url_label = wtext.substr(next_segment->getStart(), next_segment->getEnd()-next_segment->getStart());
std::string link_check = wstring_to_utf8str(url_label) + wstring_to_utf8str(next_url_label);
LLUrlMatch match;
if ( LLUrlRegistry::instance().findUrl(link_check, match))
{
if(match.getQuery() == wstring_to_utf8str(next_url_label))
{
continue;
}
}
}
// if the link's label (what the user can edit) is a valid Url,
// then update the link's HREF to be the same as the label text.
// This lets users edit Urls in-place.
if (LLUrlRegistry::instance().hasUrl(url_label))
{
std::string new_url = wstring_to_utf8str(url_label);

View File

@ -39,8 +39,6 @@
#include "lluicolortable.h"
#include "message.h"
#include "uriparser/Uri.h"
#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))"
// Utility functions
@ -48,7 +46,8 @@ std::string localize_slapp_label(const std::string& url, const std::string& full
LLUrlEntryBase::LLUrlEntryBase()
{}
{
}
LLUrlEntryBase::~LLUrlEntryBase()
{
@ -187,6 +186,30 @@ bool LLUrlEntryBase::isWikiLinkCorrect(std::string url)
return (LLUrlRegistry::instance().hasUrl(label)) ? false : true;
}
std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
{
LLUriParser up(unescapeUrl(url));
up.normalize();
std::string label;
up.extractParts();
up.glueFirst(label);
return label;
}
std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
{
LLUriParser up(unescapeUrl(url));
std::string query;
up.extractParts();
up.glueSecond(query);
return query;
}
static std::string getStringAfterToken(const std::string str, const std::string token)
{
size_t pos = str.find(token);
@ -203,6 +226,7 @@ static std::string getStringAfterToken(const std::string str, const std::string
// LLUrlEntryHTTP Describes generic http: and https: Urls
//
LLUrlEntryHTTP::LLUrlEntryHTTP()
: LLUrlEntryBase()
{
mPattern = boost::regex("https?://([-\\w\\.]+)+(:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?/?\\S*",
boost::regex::perl|boost::regex::icase);
@ -211,6 +235,25 @@ LLUrlEntryHTTP::LLUrlEntryHTTP()
}
std::string LLUrlEntryHTTP::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
return urlToLabelWithGreyQuery(url);
}
std::string LLUrlEntryHTTP::getQuery(const std::string &url) const
{
return urlToGreyQuery(url);
}
std::string LLUrlEntryHTTP::getUrl(const std::string &string) const
{
if (string.find("://") == std::string::npos)
{
return "http://" + escapeUrl(string);
}
return escapeUrl(string);
}
std::string LLUrlEntryHTTP::getTooltip(const std::string &url) const
{
return unescapeUrl(url);
}
@ -247,6 +290,7 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) const
// LLUrlEntryHTTPNoProtocol Describes generic Urls like www.google.com
//
LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
: LLUrlEntryBase()
{
mPattern = boost::regex("("
"\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR
@ -260,7 +304,12 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
std::string LLUrlEntryHTTPNoProtocol::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
return unescapeUrl(url);
return urlToLabelWithGreyQuery(url);
}
std::string LLUrlEntryHTTPNoProtocol::getQuery(const std::string &url) const
{
return urlToGreyQuery(url);
}
std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
@ -272,6 +321,95 @@ std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
return escapeUrl(string);
}
std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const
{
return unescapeUrl(url);
}
LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL()
: LLUrlEntryBase()
{
mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_http.xml";
mTooltip = LLTrans::getString("TooltipHttpUrl");
}
std::string LLUrlEntryInvalidSLURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
return escapeUrl(url);
}
std::string LLUrlEntryInvalidSLURL::getUrl(const std::string &string) const
{
return escapeUrl(string);
}
std::string LLUrlEntryInvalidSLURL::getTooltip(const std::string &url) const
{
return unescapeUrl(url);
}
bool LLUrlEntryInvalidSLURL::isSLURLvalid(const std::string &url) const
{
S32 actual_parts;
if(url.find(".com/secondlife/") != std::string::npos)
{
actual_parts = 5;
}
else if(url.find("/app/") != std::string::npos)
{
actual_parts = 6;
}
else
{
actual_parts = 3;
}
LLURI uri(url);
LLSD path_array = uri.pathArray();
S32 path_parts = path_array.size();
S32 x,y,z;
if (path_parts == actual_parts)
{
// handle slurl with (X,Y,Z) coordinates
LLStringUtil::convertToS32(path_array[path_parts-3],x);
LLStringUtil::convertToS32(path_array[path_parts-2],y);
LLStringUtil::convertToS32(path_array[path_parts-1],z);
if((x>= 0 && x<= 256) && (y>= 0 && y<= 256) && (z>= 0))
{
return TRUE;
}
}
else if (path_parts == (actual_parts-1))
{
// handle slurl with (X,Y) coordinates
LLStringUtil::convertToS32(path_array[path_parts-2],x);
LLStringUtil::convertToS32(path_array[path_parts-1],y);
;
if((x>= 0 && x<= 256) && (y>= 0 && y<= 256))
{
return TRUE;
}
}
else if (path_parts == (actual_parts-2))
{
// handle slurl with (X) coordinate
LLStringUtil::convertToS32(path_array[path_parts-1],x);
if(x>= 0 && x<= 256)
{
return TRUE;
}
}
return FALSE;
}
//
// LLUrlEntrySLURL Describes generic http: and https: Urls
//
@ -293,6 +431,7 @@ std::string LLUrlEntrySLURL::getLabel(const std::string &url, const LLUrlLabelCa
// - http://slurl.com/secondlife/Place/X
// - http://slurl.com/secondlife/Place
//
LLURI uri(url);
LLSD path_array = uri.pathArray();
S32 path_parts = path_array.size();
@ -345,29 +484,55 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
}
//
// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link
// LLUrlEntrySeconlifeURL Describes *secondlife.com/ and *lindenlab.com/ urls to substitute icon 'hand.png' before link
//
LLUrlEntrySeconlifeURL::LLUrlEntrySeconlifeURL()
{
mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?(/\\S*)?\\b",
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
{
mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?\\/\\S*",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
mMenuName = "menu_url_http.xml";
mTooltip = LLTrans::getString("TooltipHttpUrl");
}
std::string LLUrlEntrySeconlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
/// Return the url from a string that matched the regex
std::string LLUrlEntrySecondlifeURL::getUrl(const std::string &string) const
{
LLUriParser up(url);
up.extractParts();
return up.host();
if (string.find("://") == std::string::npos)
{
return "https://" + escapeUrl(string);
}
return escapeUrl(string);
}
std::string LLUrlEntrySeconlifeURL::getTooltip(const std::string &url) const
std::string LLUrlEntrySecondlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
return urlToLabelWithGreyQuery(url);
}
std::string LLUrlEntrySecondlifeURL::getQuery(const std::string &url) const
{
return urlToGreyQuery(url);
}
std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const
{
return url;
}
//
// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link
//
LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL()
{
mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(?!\\S)",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
mMenuName = "menu_url_http.xml";
}
//
// LLUrlEntryAgent Describes a Second Life agent Url, e.g.,
// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about

View File

@ -78,6 +78,9 @@ public:
/// Given a matched Url, return a label for the Url
virtual std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) { return url; }
/// Return port, query and fragment parts for the Url
virtual std::string getQuery(const std::string &url) const { return ""; }
/// Return an icon that can be displayed next to Urls of this type
virtual std::string getIcon(const std::string &url);
@ -104,6 +107,8 @@ public:
bool isWikiLinkCorrect(std::string url);
virtual bool isSLURLvalid(const std::string &url) const { return TRUE; };
protected:
std::string getIDStringFromUrl(const std::string &url) const;
std::string escapeUrl(const std::string &url) const;
@ -111,6 +116,8 @@ protected:
std::string getLabelFromWikiLink(const std::string &url) const;
std::string getUrlFromWikiLink(const std::string &string) const;
void addObserver(const std::string &id, const std::string &url, const LLUrlLabelCallback &cb);
std::string urlToLabelWithGreyQuery(const std::string &url) const;
std::string urlToGreyQuery(const std::string &url) const;
virtual void callObservers(const std::string &id, const std::string &label, const std::string& icon);
typedef struct {
@ -133,6 +140,9 @@ class LLUrlEntryHTTP : public LLUrlEntryBase
public:
LLUrlEntryHTTP();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getQuery(const std::string &url) const;
/*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getTooltip(const std::string &url) const;
};
///
@ -155,7 +165,20 @@ class LLUrlEntryHTTPNoProtocol : public LLUrlEntryBase
public:
LLUrlEntryHTTPNoProtocol();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getQuery(const std::string &url) const;
/*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getTooltip(const std::string &url) const;
};
class LLUrlEntryInvalidSLURL : public LLUrlEntryBase
{
public:
LLUrlEntryInvalidSLURL();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getTooltip(const std::string &url) const;
bool isSLURLvalid(const std::string &url) const;
};
///
@ -172,16 +195,24 @@ public:
///
/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
///
class LLUrlEntrySeconlifeURL : public LLUrlEntryBase
class LLUrlEntrySecondlifeURL : public LLUrlEntryBase
{
public:
LLUrlEntrySeconlifeURL();
bool isTrusted() const { return true; }
LLUrlEntrySecondlifeURL();
/*virtual*/ bool isTrusted() const { return true; }
/*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getQuery(const std::string &url) const;
/*virtual*/ std::string getTooltip(const std::string &url) const;
};
private:
std::string mLabel;
///
/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
///
class LLUrlEntrySimpleSecondlifeURL : public LLUrlEntrySecondlifeURL
{
public:
LLUrlEntrySimpleSecondlifeURL();
};
///

View File

@ -42,8 +42,8 @@ LLUrlMatch::LLUrlMatch() :
{
}
void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
const std::string &label, const std::string &tooltip,
void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label,
const std::string& query, const std::string &tooltip,
const std::string &icon, const LLStyle::Params& style,
const std::string &menu, const std::string &location,
const LLUUID& id, bool underline_on_hover_only, bool trusted)
@ -52,6 +52,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
mEnd = end;
mUrl = url;
mLabel = label;
mQuery = query;
mTooltip = tooltip;
mIcon = icon;
mStyle = style;

View File

@ -62,6 +62,9 @@ public:
/// return a label that can be used for the display of this Url
std::string getLabel() const { return mLabel; }
/// return a right part of url which should be drawn in grey
std::string getQuery() const { return mQuery; }
/// return a message that could be displayed in a tooltip or status bar
std::string getTooltip() const { return mTooltip; }
@ -85,10 +88,10 @@ public:
/// Change the contents of this match object (used by LLUrlRegistry)
void setValues(U32 start, U32 end, const std::string &url, const std::string &label,
const std::string &tooltip, const std::string &icon,
const std::string& query, const std::string &tooltip, const std::string &icon,
const LLStyle::Params& style, const std::string &menu,
const std::string &location, const LLUUID& id,
bool underline_on_hover_only = false, bool trusted = false );
bool underline_on_hover_only = false, bool trusted = false);
const LLUUID& getID() const { return mID; }
private:
@ -96,6 +99,7 @@ private:
U32 mEnd;
std::string mUrl;
std::string mLabel;
std::string mQuery;
std::string mTooltip;
std::string mIcon;
std::string mMenuName;

View File

@ -44,10 +44,13 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(new LLUrlEntryNoLink());
mUrlEntryIcon = new LLUrlEntryIcon();
registerUrl(mUrlEntryIcon);
mLLUrlEntryInvalidSLURL = new LLUrlEntryInvalidSLURL();
registerUrl(mLLUrlEntryInvalidSLURL);
registerUrl(new LLUrlEntrySLURL());
// decorated links for host names like: secondlife.com and lindenlab.com
registerUrl(new LLUrlEntrySeconlifeURL());
registerUrl(new LLUrlEntrySecondlifeURL());
registerUrl(new LLUrlEntrySimpleSecondlifeURL());
registerUrl(new LLUrlEntryHTTP());
mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel();
@ -188,6 +191,14 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
if (start < match_start || match_entry == NULL)
{
if (mLLUrlEntryInvalidSLURL == *it)
{
if(url_entry && url_entry->isSLURLvalid(text.substr(start, end - start + 1)))
{
continue;
}
}
if((mUrlEntryHTTPLabel == *it) || (mUrlEntrySLLabel == *it))
{
if(url_entry && !url_entry->isWikiLinkCorrect(text.substr(start, end - start + 1)))
@ -209,13 +220,17 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// fill in the LLUrlMatch object and return it
std::string url = text.substr(match_start, match_end - match_start + 1);
LLUriParser up(url);
up.normalize();
url = up.normalizedUri();
if (match_entry == mUrlEntryTrusted)
{
LLUriParser up(url);
up.normalize();
url = up.normalizedUri();
}
match.setValues(match_start, match_end,
match_entry->getUrl(url),
match_entry->getLabel(url, cb),
match_entry->getQuery(url),
match_entry->getTooltip(url),
match_entry->getIcon(url),
match_entry->getStyle(),
@ -243,7 +258,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
// character encoding, so we need to update the start
// and end values to be correct for the wide string.
LLWString wurl = utf8str_to_wstring(match.getUrl());
S32 start = text.find(wurl);
size_t start = text.find(wurl);
if (start == std::string::npos)
{
return false;
@ -252,6 +267,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
match.setValues(start, end, match.getUrl(),
match.getLabel(),
match.getQuery(),
match.getTooltip(),
match.getIcon(),
match.getStyle(),

View File

@ -93,7 +93,9 @@ private:
friend class LLSingleton<LLUrlRegistry>;
std::vector<LLUrlEntryBase *> mUrlEntry;
LLUrlEntryBase* mUrlEntryTrusted;
LLUrlEntryBase* mUrlEntryIcon;
LLUrlEntryBase* mLLUrlEntryInvalidSLURL;
LLUrlEntryBase* mUrlEntryHTTPLabel;
LLUrlEntryBase* mUrlEntrySLLabel;
};

View File

@ -50,7 +50,7 @@ bool LLViewerEventRecorder::displayViewerEventRecorderMenuItems() {
void LLViewerEventRecorder::setEventLoggingOn() {
if (! mLog.is_open()) {
mLog.open(mLogFilename, llofstream::out);
mLog.open(mLogFilename.c_str(), std::ios_base::out);
}
logEvents=true;
LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << LL_ENDL;

View File

@ -151,7 +151,7 @@ namespace tut
LLUrlMatch match;
ensure("empty()", match.empty());
match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(0, 1, "http://secondlife.com", "", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure("! empty()", ! match.empty());
}
@ -164,7 +164,7 @@ namespace tut
LLUrlMatch match;
ensure_equals("getStart() == 0", match.getStart(), 0);
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getStart() == 10", match.getStart(), 10);
}
@ -177,7 +177,7 @@ namespace tut
LLUrlMatch match;
ensure_equals("getEnd() == 0", match.getEnd(), 0);
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getEnd() == 20", match.getEnd(), 20);
}
@ -190,10 +190,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getUrl() == ''", match.getUrl(), "");
match.setValues(10, 20, "http://slurl.com/", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "http://slurl.com/", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/");
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getUrl() == '' (2)", match.getUrl(), "");
}
@ -206,10 +206,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getLabel() == ''", match.getLabel(), "");
match.setValues(10, 20, "", "Label", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "Label", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label");
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getLabel() == '' (2)", match.getLabel(), "");
}
@ -222,10 +222,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getTooltip() == ''", match.getTooltip(), "");
match.setValues(10, 20, "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info");
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getTooltip() == '' (2)", match.getTooltip(), "");
}
@ -238,10 +238,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getIcon() == ''", match.getIcon(), "");
match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon");
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure_equals("getIcon() == '' (2)", match.getIcon(), "");
}
@ -254,10 +254,10 @@ namespace tut
LLUrlMatch match;
ensure("getMenuName() empty", match.getMenuName().empty());
match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null);
ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml");
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure("getMenuName() empty (2)", match.getMenuName().empty());
}
@ -270,10 +270,10 @@ namespace tut
LLUrlMatch match;
ensure("getLocation() empty", match.getLocation().empty());
match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null);
ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris");
match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null);
ensure("getLocation() empty (2)", match.getLocation().empty());
}
}

View File

@ -95,7 +95,7 @@ LLPidLockFile& LLPidLockFile::instance()
void LLPidLockFile::writeLockFile(LLSD pids)
{
llofstream ofile(mLockName);
llofstream ofile(mLockName.c_str());
if (!LLSDSerialize::toXML(pids,ofile))
{
@ -119,7 +119,7 @@ bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave,
LLSD out_pids;
out_pids.append( (LLSD::Integer)mPID );
llifstream ifile(mLockName);
llifstream ifile(mLockName.c_str());
if (ifile.is_open())
{ //If file exists, we need to decide whether or not to continue.
@ -175,7 +175,7 @@ bool LLPidLockFile::checkLock()
void LLPidLockFile::releaseLock()
{
llifstream ifile(mLockName);
llifstream ifile(mLockName.c_str());
LLSD in_pids;
LLSD out_pids;
bool write_file=FALSE;

View File

@ -51,4 +51,3 @@ LLWindowHeadless::~LLWindowHeadless()
void LLWindowHeadless::swapBuffers()
{
}

View File

@ -75,7 +75,8 @@ public:
/*virtual*/ void delayInputProcessing() {};
/*virtual*/ void swapBuffers();
// handy coordinate space conversion routines
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };
/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; };
/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; };

View File

@ -898,6 +898,11 @@ void LLWindowMacOSX::swapBuffers()
CGLFlushDrawable(mContext);
}
void LLWindowMacOSX::restoreGLContext()
{
CGLSetCurrentContext(mContext);
}
F32 LLWindowMacOSX::getGamma()
{
F32 result = 2.2; // Default to something sane
@ -1152,6 +1157,8 @@ void LLWindowMacOSX::beforeDialog()
void LLWindowMacOSX::afterDialog()
{
//For fix problem with Core Flow view on OSX
restoreGLContext();
}

View File

@ -87,7 +87,7 @@ public:
/*virtual*/ void gatherInput();
/*virtual*/ void delayInputProcessing() {};
/*virtual*/ void swapBuffers();
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to);
/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to);
@ -155,7 +155,9 @@ protected:
//Satisfy MAINT-3135 and MAINT-3288 with a flag.
/*virtual */ void setOldResize(bool oldresize) {setResizeMode(oldresize, mGLView); }
private:
void restoreGLContext();
protected:
//

View File

@ -77,6 +77,7 @@ public:
/*virtual*/ void gatherInput() {};
/*virtual*/ void delayInputProcessing() {};
/*virtual*/ void swapBuffers();
/*virtual*/ void restoreGLContext() {};
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };

View File

@ -97,6 +97,7 @@ public:
/*virtual*/ void processMiscNativeEvents();
/*virtual*/ void gatherInput();
/*virtual*/ void swapBuffers();
/*virtual*/ void restoreGLContext() {};
/*virtual*/ void delayInputProcessing() { };

View File

@ -83,6 +83,7 @@ public:
/*virtual*/ void gatherInput();
/*virtual*/ void delayInputProcessing();
/*virtual*/ void swapBuffers();
/*virtual*/ void restoreGLContext() {};
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to);

View File

@ -833,7 +833,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
}
}
llofstream file;
file.open(filename);
file.open(filename.c_str());
if (file.is_open())
{
LLSDSerialize::toPrettyXML(settings, file);
@ -853,7 +853,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
{
LLSD settings;
llifstream infile;
infile.open(filename);
infile.open(filename.c_str());
if(!infile.is_open())
{
LL_WARNS("Settings") << "Cannot find file " << filename << " to load." << LL_ENDL;

View File

@ -80,7 +80,7 @@ namespace tut
}
void writeSettingsFile(const LLSD& config)
{
llofstream file(mTestConfigFile);
llofstream file(mTestConfigFile.c_str());
if (file.is_open())
{
LLSDSerialize::toPrettyXML(config, file);

View File

@ -1 +1 @@
3.7.27
3.7.31

View File

@ -49,6 +49,17 @@
<key>Value</key>
<real>300</real>
</map>
<key>AckCollectTime</key>
<map>
<key>Comment</key>
<string>Ack messages collection and grouping time</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.1</real>
</map>
<key>AdminMenu</key>
<map>
<key>Comment</key>
@ -5019,6 +5030,7 @@
<key>Type</key>
<string>LLSD</string>
<key>Value</key>
<array/>
</map>
<key>LSLFindCaseInsensitivity</key>
<map>
@ -11765,7 +11777,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
<integer>0.0</integer>
<real>0.0</real>
</map>
<key>TextureFetchSource</key>
<map>
@ -13208,6 +13220,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>EnvironmentPersistAcrossLogin</key>
<map>
<key>Comment</key>
<string>Keep Environment settings consistent across sessions</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>UseDayCycle</key>
<map>
<key>Comment</key>
@ -14099,17 +14122,6 @@
<key>Value</key>
<integer>-1</integer>
</map>
<key>MaxFPS</key>
<map>
<key>Comment</key>
<string>Yield some time to the local host if we reach a threshold framerate.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>-1.0</real>
</map>
<key>ForcePeriodicRenderingTime</key>
<map>
<key>Comment</key>
@ -14682,17 +14694,6 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>UseHTTPInventory</key>
<map>
<key>Comment</key>
<string>Allow use of http inventory transfers instead of UDP</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ClickToWalk</key>
<map>
<key>Comment</key>

View File

@ -97,7 +97,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>true</integer>
<integer>1</integer>
</map>
<key>InstantMessageLogPath</key>
<map>

View File

@ -398,6 +398,8 @@ LLAgent::LLAgent() :
mAutoPilotFinishedCallback(NULL),
mAutoPilotCallbackData(NULL),
mMovementKeysLocked(FALSE),
mEffectColor(new LLUIColor(LLColor4(0.f, 1.f, 1.f, 1.f))),
mHaveHomePosition(FALSE),

View File

@ -515,6 +515,9 @@ public:
void moveYaw(F32 mag, bool reset_view = true);
void movePitch(F32 mag);
BOOL isMovementLocked() const { return mMovementKeysLocked; }
void setMovementLocked(BOOL set_locked) { mMovementKeysLocked = set_locked; }
//--------------------------------------------------------------------
// Move the avatar's frame
//--------------------------------------------------------------------
@ -569,6 +572,7 @@ private:
void (*mAutoPilotFinishedCallback)(BOOL, void *);
void* mAutoPilotCallbackData;
LLUUID mLeaderID;
BOOL mMovementKeysLocked;
/** Movement
** **

View File

@ -35,6 +35,7 @@
#include "llfloaterreg.h"
#include "llhudmanager.h"
#include "lljoystickbutton.h"
#include "llmorphview.h"
#include "llmoveview.h"
#include "llselectmgr.h"
#include "llsmoothstep.h"
@ -2267,7 +2268,10 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
gFocusMgr.setKeyboardFocus( NULL );
gFocusMgr.setMouseCapture( NULL );
if( gMorphView )
{
gMorphView->setVisible( TRUE );
}
// Remove any pitch or rotation from the avatar
LLVector3 at = gAgent.getAtAxis();
at.mV[VZ] = 0.f;

View File

@ -84,7 +84,7 @@ void LLAgentPilot::loadTxt(const std::string& filename)
return;
}
llifstream file(filename);
llifstream file(filename.c_str());
if (!file)
{
@ -125,7 +125,7 @@ void LLAgentPilot::loadXML(const std::string& filename)
return;
}
llifstream file(filename);
llifstream file(filename.c_str());
if (!file)
{
@ -168,7 +168,7 @@ void LLAgentPilot::save()
void LLAgentPilot::saveTxt(const std::string& filename)
{
llofstream file;
file.open(filename);
file.open(filename.c_str());
if (!file)
{
@ -191,7 +191,7 @@ void LLAgentPilot::saveTxt(const std::string& filename)
void LLAgentPilot::saveXML(const std::string& filename)
{
llofstream file;
file.open(filename);
file.open(filename.c_str());
if (!file)
{

View File

@ -633,10 +633,13 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed)
// the versions themselves are compatible. This code can be removed before release.
if( wearable->getDefinitionVersion() == 24 )
{
wearable->setDefinitionVersion(22);
U32 index = getWearableIndex(wearable);
LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL;
saveWearable(wearable->getType(),index);
U32 index;
if (getWearableIndex(wearable,index))
{
LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL;
wearable->setDefinitionVersion(22);
saveWearable(wearable->getType(),index);
}
}
checkWearableAgainstInventory(viewer_wearable);
@ -949,7 +952,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo
LLViewerWearable* old_wearable = getViewerWearable(type,i);
if (old_wearable)
{
popWearable(old_wearable);
eraseWearable(old_wearable);
old_wearable->removeFromAvatar();
}
}
@ -961,7 +964,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo
if (old_wearable)
{
popWearable(old_wearable);
eraseWearable(old_wearable);
old_wearable->removeFromAvatar();
}
}
@ -1163,7 +1166,13 @@ bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD&
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID());
U32 index = gAgentWearables.getWearableIndex(wearable);
U32 index;
if (!gAgentWearables.getWearableIndex(wearable,index))
{
LL_WARNS() << "Wearable not found" << LL_ENDL;
delete wearable;
return false;
}
if (!new_item)
{
delete wearable;

View File

@ -1338,90 +1338,113 @@ void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false)
}
}
bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear,
void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear,
bool do_update,
bool replace,
LLPointer<LLInventoryCallback> cb)
{
bool first = true;
LLInventoryObject::const_object_list_t items_to_link;
for (uuid_vec_t::const_iterator it = item_ids_to_wear.begin();
it != item_ids_to_wear.end();
++it)
{
replace = first && replace;
first = false;
const LLUUID& item_id_to_wear = *it;
if (item_id_to_wear.isNull()) continue;
LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear);
if (!item_to_wear) continue;
if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID()))
{
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace));
copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb);
continue;
}
else if (!gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getRootFolderID()))
{
continue; // not in library and not in agent's inventory
}
else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))
{
LLNotificationsUtil::add("CannotWearTrash");
continue;
}
else if (isLinkedInCOF(item_to_wear->getUUID())) // EXT-84911
{
continue;
}
switch (item_to_wear->getType())
{
case LLAssetType::AT_CLOTHING:
{
if (gAgentWearables.areWearablesLoaded())
{
if (!cb && do_update)
{
cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
}
LLWearableType::EType type = item_to_wear->getWearableType();
S32 wearable_count = gAgentWearables.getWearableCount(type);
if ((replace && wearable_count != 0) || !gAgentWearables.canAddWearable(type))
{
LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(),
wearable_count-1);
removeCOFItemLinks(item_id, cb);
}
items_to_link.push_back(item_to_wear);
}
}
break;
case LLAssetType::AT_BODYPART:
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
// Remove the existing wearables of the same type.
// Remove existing body parts anyway because we must not be able to wear e.g. two skins.
removeCOFLinksOfType(item_to_wear->getWearableType());
if (!cb && do_update)
{
cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
}
items_to_link.push_back(item_to_wear);
}
break;
case LLAssetType::AT_OBJECT:
{
rez_attachment(item_to_wear, NULL, replace);
}
break;
default: continue;
}
}
// Batch up COF link creation - more efficient if using AIS.
if (items_to_link.size())
{
link_inventory_array(getCOF(), items_to_link, cb);
}
}
void LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear,
bool do_update,
bool replace,
LLPointer<LLInventoryCallback> cb)
{
if (item_id_to_wear.isNull()) return false;
// *TODO: issue with multi-wearable should be fixed:
// in this case this method will be called N times - loading started for each item
// and than N times will be called - loading completed for each item.
// That means subscribers will be notified that loading is done after first item in a batch is worn.
// (loading indicator disappears for example before all selected items are worn)
// Have not fix this issue for 2.1 because of stability reason. EXT-7777.
// Disabled for now because it is *not* acceptable to call updateAppearanceFromCOF() multiple times
// gAgentWearables.notifyLoadingStarted();
LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear);
if (!item_to_wear) return false;
if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID()))
{
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace));
copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb);
return false;
}
else if (!gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getRootFolderID()))
{
return false; // not in library and not in agent's inventory
}
else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))
{
LLNotificationsUtil::add("CannotWearTrash");
return false;
}
else if (isLinkedInCOF(item_to_wear->getUUID())) // EXT-84911
{
return false;
}
switch (item_to_wear->getType())
{
case LLAssetType::AT_CLOTHING:
if (gAgentWearables.areWearablesLoaded())
{
if (!cb && do_update)
{
cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
}
S32 wearable_count = gAgentWearables.getWearableCount(item_to_wear->getWearableType());
if ((replace && wearable_count != 0) ||
(wearable_count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) )
{
LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(),
wearable_count-1);
removeCOFItemLinks(item_id, cb);
}
addCOFItemLink(item_to_wear, cb);
}
break;
case LLAssetType::AT_BODYPART:
// TODO: investigate wearables may not be loaded at this point EXT-8231
// Remove the existing wearables of the same type.
// Remove existing body parts anyway because we must not be able to wear e.g. two skins.
removeCOFLinksOfType(item_to_wear->getWearableType());
if (!cb && do_update)
{
cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
}
addCOFItemLink(item_to_wear, cb);
break;
case LLAssetType::AT_OBJECT:
rez_attachment(item_to_wear, NULL, replace);
break;
default: return false;;
}
return true;
uuid_vec_t ids;
ids.push_back(item_id_to_wear);
wearItemsOnAvatar(ids, do_update, replace, cb);
}
// Update appearance from outfit folder.
@ -1782,6 +1805,49 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
return items.size() > 0;
}
// Moved from LLWearableList::ContextMenu for wider utility.
bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids)
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
U32 n_objects = 0;
U32 n_clothes = 0;
// Count given clothes (by wearable type) and objects.
for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
if (!item)
{
return false;
}
if (item->getType() == LLAssetType::AT_OBJECT)
{
++n_objects;
}
else if (item->getType() == LLAssetType::AT_CLOTHING)
{
++n_clothes;
}
else
{
LL_WARNS() << "Unexpected wearable type" << LL_ENDL;
return false;
}
}
// Check whether we can add all the objects.
if (!isAgentAvatarValid() || !gAgentAvatarp->canAttachMoreObjects(n_objects))
{
return false;
}
// Check whether we can add all the clothes.
U32 sum_clothes = n_clothes + gAgentWearables.getClothingLayerCount();
return sum_clothes <= LLAgentWearables::MAX_CLOTHING_LAYERS;
}
void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb)
{
LLInventoryModel::cat_array_t cats;
@ -1804,25 +1870,39 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLIn
// Keep the last N wearables of each type. For viewer 2.0, N is 1 for
// both body parts and clothing items.
void LLAppearanceMgr::filterWearableItems(
LLInventoryModel::item_array_t& items, S32 max_per_type)
LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total)
{
// Divvy items into arrays by wearable type.
std::vector<LLInventoryModel::item_array_t> items_by_type(LLWearableType::WT_COUNT);
divvyWearablesByType(items, items_by_type);
// Restrict by max total items first.
if ((max_total > 0) && (items.size() > max_total))
{
LLInventoryModel::item_array_t items_to_keep;
for (S32 i=0; i<max_total; i++)
{
items_to_keep.push_back(items[i]);
}
items = items_to_keep;
}
// rebuild items list, retaining the last max_per_type of each array
items.clear();
for (S32 i=0; i<LLWearableType::WT_COUNT; i++)
{
S32 size = items_by_type[i].size();
if (size <= 0)
continue;
S32 start_index = llmax(0,size-max_per_type);
for (S32 j = start_index; j<size; j++)
{
items.push_back(items_by_type[i][j]);
}
}
if (max_per_type > 0)
{
// Divvy items into arrays by wearable type.
std::vector<LLInventoryModel::item_array_t> items_by_type(LLWearableType::WT_COUNT);
divvyWearablesByType(items, items_by_type);
// rebuild items list, retaining the last max_per_type of each array
items.clear();
for (S32 i=0; i<LLWearableType::WT_COUNT; i++)
{
S32 size = items_by_type[i].size();
if (size <= 0)
continue;
S32 start_index = llmax(0,size-max_per_type);
for (S32 j = start_index; j<size; j++)
{
items.push_back(items_by_type[i][j]);
}
}
}
}
void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
@ -1864,7 +1944,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
reverse(body_items.begin(), body_items.end());
// Reduce body items to max of one per type.
removeDuplicateItems(body_items);
filterWearableItems(body_items, 1);
filterWearableItems(body_items, 1, 0);
// - Wearables: include COF contents only if appending.
LLInventoryModel::item_array_t wear_items;
@ -1873,7 +1953,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING);
// Reduce wearables to max of one per type.
removeDuplicateItems(wear_items);
filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE);
filterWearableItems(wear_items, 0, LLAgentWearables::MAX_CLOTHING_LAYERS);
// - Attachments: include COF contents only if appending.
LLInventoryModel::item_array_t obj_items;
@ -2062,7 +2142,8 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list,
S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id,
LLAssetType::EType type,
S32 max_items,
S32 max_items_per_type,
S32 max_items_total,
LLInventoryObject::object_list_t& items_to_kill)
{
S32 to_kill_count = 0;
@ -2071,9 +2152,9 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id,
getDescendentsOfAssetType(cat_id, items, type);
LLInventoryModel::item_array_t curr_items = items;
removeDuplicateItems(items);
if (max_items > 0)
if (max_items_per_type > 0 || max_items_total > 0)
{
filterWearableItems(items, max_items);
filterWearableItems(items, max_items_per_type, max_items_total);
}
LLInventoryModel::item_array_t kill_items;
item_array_diff(curr_items,items,kill_items);
@ -2092,11 +2173,11 @@ void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id,
LLInventoryObject::object_list_t& items_to_kill)
{
findExcessOrDuplicateItems(cat_id,LLAssetType::AT_BODYPART,
1, items_to_kill);
1, 0, items_to_kill);
findExcessOrDuplicateItems(cat_id,LLAssetType::AT_CLOTHING,
LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill);
0, LLAgentWearables::MAX_CLOTHING_LAYERS, items_to_kill);
findExcessOrDuplicateItems(cat_id,LLAssetType::AT_OBJECT,
-1, items_to_kill);
0, 0, items_to_kill);
}
void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb)
@ -2588,7 +2669,6 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
bool linked_already = false;
U32 count = 0;
for (S32 i=0; i<item_array.size(); i++)
{
// Are these links to the same object?
@ -2608,14 +2688,13 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item,
// type? If so, new item will replace old.
else if ((vitem->isWearableType()) && (vitem->getWearableType() == wearable_type))
{
++count;
if (is_body_part && inv_item->getIsLinkType() && (vitem->getWearableType() == wearable_type))
if (is_body_part && inv_item->getIsLinkType())
{
remove_inventory_item(inv_item->getUUID(), cb);
}
else if (count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE)
else if (!gAgentWearables.canAddWearable(wearable_type))
{
// MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE
// MULTI-WEARABLES: make sure we don't go over clothing limits
remove_inventory_item(inv_item->getUUID(), cb);
}
}
@ -4071,16 +4150,7 @@ void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb)
void wear_multiple(const uuid_vec_t& ids, bool replace)
{
LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
bool first = true;
uuid_vec_t::const_iterator it;
for (it = ids.begin(); it != ids.end(); ++it)
{
// if replace is requested, the first item worn will replace the current top
// item, and others will be added.
LLAppearanceMgr::instance().wearItemOnAvatar(*it,false,first && replace,cb);
first = false;
}
LLAppearanceMgr::instance().wearItemsOnAvatar(ids, false, replace, cb);
}
// SLapp for easy-wearing of a stock (library) avatar

View File

@ -67,7 +67,8 @@ public:
void addCategoryToCurrentOutfit(const LLUUID& cat_id);
S32 findExcessOrDuplicateItems(const LLUUID& cat_id,
LLAssetType::EType type,
S32 max_items,
S32 max_items_per_type,
S32 max_items_total,
LLInventoryObject::object_list_t& items_to_kill);
void findAllExcessOrDuplicateItems(const LLUUID& cat_id,
LLInventoryObject::object_list_t& items_to_kill);
@ -99,6 +100,9 @@ public:
// Determine whether we can replace current outfit with the given one.
bool getCanReplaceCOF(const LLUUID& outfit_cat_id);
// Can we add all referenced items to the avatar?
bool canAddWearables(const uuid_vec_t& item_ids);
// Copy all items in a category.
void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb);
@ -117,8 +121,13 @@ public:
// find the UUID of the currently worn outfit (Base Outfit)
const LLUUID getBaseOutfitUUID();
void wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear,
bool do_update,
bool replace,
LLPointer<LLInventoryCallback> cb = NULL);
// Wear/attach an item (from a user's inventory) on the agent
bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false,
void wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false,
LLPointer<LLInventoryCallback> cb = NULL);
// Update the displayed outfit name in UI.
@ -235,7 +244,7 @@ protected:
private:
void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type);
void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total);
void getDescendentsOfAssetType(const LLUUID& category,
LLInventoryModel::item_array_t& items,

View File

@ -684,6 +684,8 @@ LLAppViewer::LLAppViewer()
mQuitRequested(false),
mLogoutRequestSent(false),
mYieldTime(-1),
mLastAgentControlFlags(0),
mLastAgentForceUpdate(0),
mMainloopTimeout(NULL),
mAgentRegionLastAlive(false),
mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)),
@ -3272,7 +3274,7 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
: getDynamicDebugFile() );
LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL;
llofstream out_file(*debug_filename);
llofstream out_file(debug_filename->c_str());
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
@ -3761,7 +3763,7 @@ void LLAppViewer::handleViewerCrash()
{
std::string filename;
filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log");
llofstream file(filename, llofstream::binary);
llofstream file(filename.c_str(), std::ios_base::binary);
if(file.good())
{
LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL;
@ -4649,17 +4651,22 @@ void LLAppViewer::loadNameCache()
std::string filename =
gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml");
LL_INFOS("AvNameCache") << filename << LL_ENDL;
llifstream name_cache_stream(filename);
llifstream name_cache_stream(filename.c_str());
if(name_cache_stream.is_open())
{
LLAvatarNameCache::importFile(name_cache_stream);
if ( ! LLAvatarNameCache::importFile(name_cache_stream))
{
LL_WARNS("AppInit") << "removing invalid '" << filename << "'" << LL_ENDL;
name_cache_stream.close();
LLFile::remove(filename);
}
}
if (!gCacheName) return;
std::string name_cache;
name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
llifstream cache_file(name_cache);
llifstream cache_file(name_cache.c_str());
if(cache_file.is_open())
{
if(gCacheName->importFile(cache_file)) return;
@ -4667,24 +4674,26 @@ void LLAppViewer::loadNameCache()
}
void LLAppViewer::saveNameCache()
{
{
// display names cache
std::string filename =
gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml");
llofstream name_cache_stream(filename);
llofstream name_cache_stream(filename.c_str());
if(name_cache_stream.is_open())
{
LLAvatarNameCache::exportFile(name_cache_stream);
}
if (!gCacheName) return;
std::string name_cache;
name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
llofstream cache_file(name_cache);
if(cache_file.is_open())
{
gCacheName->exportFile(cache_file);
}
// real names cache
if (gCacheName)
{
std::string name_cache;
name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache");
llofstream cache_file(name_cache.c_str());
if(cache_file.is_open())
{
gCacheName->exportFile(cache_file);
}
}
}
@ -4812,22 +4821,24 @@ void LLAppViewer::idle()
gAgentPilot.updateTarget();
gAgent.autoPilot(&yaw);
}
static LLFrameTimer agent_update_timer;
static U32 last_control_flags;
// When appropriate, update agent location to the simulator.
F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags());
if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
{
LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE);
// Send avatar and camera info
last_control_flags = gAgent.getControlFlags();
send_agent_update(TRUE);
agent_update_timer.reset();
}
static LLFrameTimer agent_update_timer;
// When appropriate, update agent location to the simulator.
F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time;
BOOL force_update = gAgent.controlFlagsDirty()
|| (mLastAgentControlFlags != gAgent.getControlFlags())
|| (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND));
if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
{
LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE);
// Send avatar and camera info
mLastAgentControlFlags = gAgent.getControlFlags();
mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time;
send_agent_update(force_update);
agent_update_timer.reset();
}
}
//////////////////////////////////////
@ -5375,7 +5386,7 @@ void LLAppViewer::idleNetwork()
}
// Handle per-frame message system processing.
gMessageSystem->processAcks();
gMessageSystem->processAcks(gSavedSettings.getF32("AckCollectTime"));
#ifdef TIME_THROTTLE_MESSAGES
if (total_time >= CheckMessagesMaxTime)

View File

@ -275,6 +275,8 @@ private:
bool mQuitRequested; // User wants to quit, may have modified documents open.
bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
S32 mYieldTime;
U32 mLastAgentControlFlags;
F32 mLastAgentForceUpdate;
struct SettingsFiles* mSettingsLocationList;
LLWatchdogTimeout* mMainloopTimeout;
@ -314,6 +316,7 @@ public:
// consts from viewer.h
const S32 AGENT_UPDATES_PER_SECOND = 10;
const S32 AGENT_FORCE_UPDATES_PER_SECOND = 1;
// Globals with external linkage. From viewer.h
// *NOTE:Mani - These will be removed as the Viewer App Cleanup project continues.

View File

@ -226,21 +226,34 @@ void LLAssetUploadResponder::httpFailure()
{
// *TODO: Add adaptive retry policy?
LL_WARNS() << dumpResponse() << LL_ENDL;
LLSD args;
std::string reason;
if (isHttpClientErrorStatus(getStatus()))
{
args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
args["REASON"] = "Error in upload request. Please visit "
reason = "Error in upload request. Please visit "
"http://secondlife.com/support for help fixing this problem.";
LLNotificationsUtil::add("CannotUploadReason", args);
}
else
{
args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
args["REASON"] = "The server is experiencing unexpected "
reason = "The server is experiencing unexpected "
"difficulties.";
LLNotificationsUtil::add("CannotUploadReason", args);
}
LLSD args;
args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
args["REASON"] = reason;
LLNotificationsUtil::add("CannotUploadReason", args);
// unfreeze script preview
if(mAssetType == LLAssetType::AT_LSL_TEXT)
{
LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", mPostData["item_id"]);
if (preview)
{
LLSD errors;
errors.append(LLTrans::getString("UploadFailed") + reason);
preview->callbackLSLCompileFailed(errors);
}
}
LLUploadDialog::modalUploadFinished();
LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails
}
@ -295,8 +308,22 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content)
void LLAssetUploadResponder::uploadFailure(const LLSD& content)
{
LL_WARNS() << dumpResponse() << LL_ENDL;
// unfreeze script preview
if(mAssetType == LLAssetType::AT_LSL_TEXT)
{
LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", mPostData["item_id"]);
if (preview)
{
LLSD errors;
errors.append(LLTrans::getString("UploadFailed") + content["message"].asString());
preview->callbackLSLCompileFailed(errors);
}
}
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
if (floater_snapshot)
{
@ -622,7 +649,10 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
}
else
{
LLLiveLSLEditor* preview = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", LLSD(item_id));
LLSD floater_key;
floater_key["taskid"] = task_id;
floater_key["itemid"] = item_id;
LLLiveLSLEditor* preview = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key);
if (preview)
{
// Bytecode save completed

View File

@ -745,7 +745,7 @@ namespace action_give_inventory
}
std::string residents;
LLAvatarActions::buildResidentsString(avatar_names, residents);
LLAvatarActions::buildResidentsString(avatar_names, residents, true);
std::string items;
build_items_string(inventory_selected_uuids, items);
@ -777,7 +777,7 @@ namespace action_give_inventory
}
// static
void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string)
void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string, bool complete_name)
{
llassert(avatar_names.size() > 0);
@ -785,7 +785,15 @@ void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_name
const std::string& separator = LLTrans::getString("words_separator");
for (std::vector<LLAvatarName>::const_iterator it = avatar_names.begin(); ; )
{
residents_string.append((*it).getDisplayName());
if(complete_name)
{
residents_string.append((*it).getCompleteName());
}
else
{
residents_string.append((*it).getDisplayName());
}
if (++it == avatar_names.end())
{
break;

View File

@ -221,7 +221,7 @@ public:
* @param avatar_names - a vector of given avatar names from which resulting string is built
* @param residents_string - the resulting string
*/
static void buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string);
static void buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string, bool complete_name = false);
/**
* Builds a string of residents' display names separated by "words_separator" string.

View File

@ -76,7 +76,7 @@ void LLAvatarIconIDCache::load ()
// build filename for each user
std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename);
llifstream file(resolved_filename);
llifstream file(resolved_filename.c_str());
if (!file.is_open())
return;
@ -114,7 +114,7 @@ void LLAvatarIconIDCache::save ()
std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename);
// open a file for writing
llofstream file (resolved_filename);
llofstream file (resolved_filename.c_str());
if (!file.is_open())
{
LL_WARNS() << "can't open avatar icons cache file\"" << mFilename << "\" for writing" << LL_ENDL;

View File

@ -860,7 +860,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
{
LLAvatarName av_name;
LLAvatarNameCache::get( buddy_id, &av_name);
buddy_map_t::value_type value(av_name.getDisplayName(), buddy_id);
buddy_map_t::value_type value(buddy_id, av_name.getDisplayName());
if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION))
{
mMappable.insert(value);
@ -871,7 +871,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy)
{
gCacheName->getFullName(buddy_id, mFullName);
buddy_map_t::value_type value(mFullName, buddy_id);
buddy_map_t::value_type value(buddy_id, mFullName);
if(buddy->isOnline())
{
mOnline.insert(value);
@ -883,8 +883,8 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud
{
LLAvatarName av_name;
LLAvatarNameCache::get(buddy_id, &av_name);
mFullName = av_name.getDisplayName();
buddy_map_t::value_type value(mFullName, buddy_id);
mFullName = av_name.getCompleteName();
buddy_map_t::value_type value(buddy_id, mFullName);
if(buddy->isOnline())
{
mOnline.insert(value);

View File

@ -233,7 +233,7 @@ public:
LLCollectMappableBuddies() {}
virtual ~LLCollectMappableBuddies() {}
virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
typedef std::map<LLUUID, std::string> buddy_map_t;
buddy_map_t mMappable;
std::string mFullName;
};
@ -245,7 +245,7 @@ public:
LLCollectOnlineBuddies() {}
virtual ~LLCollectOnlineBuddies() {}
virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
typedef std::map<LLUUID, std::string> buddy_map_t;
buddy_map_t mOnline;
std::string mFullName;
};
@ -258,7 +258,7 @@ public:
LLCollectAllBuddies() {}
virtual ~LLCollectAllBuddies() {}
virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
typedef std::map<LLUUID, std::string> buddy_map_t;
buddy_map_t mOnline;
buddy_map_t mOffline;
std::string mFullName;

View File

@ -1113,7 +1113,15 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
if (irc_me && !use_plain_text_chat_history)
{
message = chat.mFromName + message;
std::string from_name = chat.mFromName;
LLAvatarName av_name;
if (!chat.mFromID.isNull() &&
LLAvatarNameCache::get(chat.mFromID, &av_name) &&
!av_name.isDisplayNameDefault())
{
from_name = av_name.getCompleteName();
}
message = from_name + message;
}
if (square_brackets)

View File

@ -376,6 +376,14 @@ BOOL LLIMChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
return TRUE;
}
void LLIMChiclet::hidePopupMenu()
{
if (mPopupMenu)
{
mPopupMenu->setVisible(FALSE);
}
}
bool LLIMChiclet::canCreateMenu()
{
if(mPopupMenu)

View File

@ -305,6 +305,8 @@ public:
*/
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
void hidePopupMenu();
protected:
LLIMChiclet(const LLIMChiclet::Params& p);

View File

@ -622,7 +622,7 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG
LLSD clpConfigLLSD;
llifstream input_stream;
input_stream.open(config_filename, std::ios::in | std::ios::binary);
input_stream.open(config_filename.c_str(), std::ios::in | std::ios::binary);
if(input_stream.is_open())
{

View File

@ -296,7 +296,7 @@ BOOL LLConversationViewSession::handleMouseUp( S32 x, S32 y, MASK mask )
LLFloater* volume_floater = LLFloaterReg::findInstance("floater_voice_volume");
LLFloater* chat_volume_floater = LLFloaterReg::findInstance("chat_voice");
if (result
&& getRoot()
&& getRoot() && (getRoot()->getCurSelectedItem() == this)
&& !(volume_floater && volume_floater->isShown() && volume_floater->hasFocus())
&& !(chat_volume_floater && chat_volume_floater->isShown() && chat_volume_floater->hasFocus()))
{

View File

@ -207,7 +207,7 @@ bool LLDayCycleManager::addPreset(const std::string& name, const LLSD& data)
{
if (name.empty())
{
llassert(name.empty());
//llassert(name.empty());
return false;
}

View File

@ -1116,7 +1116,14 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
retval = gPipeline.getSpatialPartition((LLViewerObject*) mVObjp);
}
else if (isRoot())
{ //must be an active volume
{
if (mSpatialBridge && (mSpatialBridge->asPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD) != mVObjp->isHUDAttachment())
{
// remove obsolete bridge
mSpatialBridge->markDead();
setSpatialBridge(NULL);
}
//must be an active volume
if (!mSpatialBridge)
{
if (mVObjp->isHUDAttachment())

View File

@ -303,7 +303,8 @@ void LLEnvManagerNew::loadUserPrefs()
mUserPrefs.mSkyPresetName = gSavedSettings.getString("SkyPresetName");
mUserPrefs.mDayCycleName = gSavedSettings.getString("DayCycleName");
mUserPrefs.mUseRegionSettings = gSavedSettings.getBOOL("UseEnvironmentFromRegion");
bool use_region_settings = gSavedSettings.getBOOL("EnvironmentPersistAcrossLogin") ? gSavedSettings.getBOOL("UseEnvironmentFromRegion") : true;
mUserPrefs.mUseRegionSettings = use_region_settings;
mUserPrefs.mUseDayCycle = gSavedSettings.getBOOL("UseDayCycle");
if (mUserPrefs.mUseRegionSettings)

View File

@ -344,10 +344,38 @@ void LLFace::dirtyTexture()
gPipeline.markTextured(drawablep);
}
void LLFace::notifyAboutCreatingTexture(LLViewerTexture *texture)
{
LLDrawable* drawablep = getDrawable();
if(mVObjp.notNull() && mVObjp->getVolume())
{
LLVOVolume *vobj = drawablep->getVOVolume();
if(vobj && vobj->notifyAboutCreatingTexture(texture))
{
gPipeline.markTextured(drawablep);
gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME);
}
}
}
void LLFace::notifyAboutMissingAsset(LLViewerTexture *texture)
{
LLDrawable* drawablep = getDrawable();
if(mVObjp.notNull() && mVObjp->getVolume())
{
LLVOVolume *vobj = drawablep->getVOVolume();
if(vobj && vobj->notifyAboutMissingAsset(texture))
{
gPipeline.markTextured(drawablep);
gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME);
}
}
}
void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture)
{
llassert(ch < LLRender::NUM_TEXTURE_CHANNELS);
if(mTexture[ch] == new_texture)
{
return ;
@ -956,6 +984,10 @@ void LLFace::getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_po
const LLVolumeFace& vf = getViewerObject()->getVolume()->getVolumeFace(mTEOffset);
const LLVector4a& normal4a = vf.mNormals[0];
const LLVector4a& tangent = vf.mTangents[0];
if (!&tangent)
{
return;
}
LLVector4a binormal4a;
binormal4a.setCross3(normal4a, tangent);
@ -1299,15 +1331,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
if (shiny_in_alpha)
{
GLfloat alpha[4] =
{
0.00f,
0.25f,
0.5f,
0.75f
};
static const GLfloat alpha[4] =
{
0.00f,
0.25f,
0.5f,
0.75f
};
llassert(tep->getShiny() <= 3);
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);

Some files were not shown because too many files have changed in this diff Show More